mirror of
https://github.com/project-zot/zot.git
synced 2026-06-16 04:17:55 +08:00
refactor: Cleanup/simplify testcases in /pkg/extensions (#1116)
Signed-off-by: Nicol Draghici <idraghic@cisco.com> fix: Increase coverage when copying files Signed-off-by: Nicol Draghici <idraghic@cisco.com>
This commit is contained in:
@@ -179,6 +179,13 @@ func CopyFiles(sourceDir, destDir string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func CopyTestFiles(sourceDir, destDir string) {
|
||||
err := CopyFiles(sourceDir, destDir)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
type Controller interface {
|
||||
Run(ctx context.Context) error
|
||||
Shutdown()
|
||||
|
||||
@@ -113,6 +113,9 @@ func TestCopyFiles(t *testing.T) {
|
||||
_, err = os.Stat(path.Join(dstDir, "test-index", "index.json"))
|
||||
So(err, ShouldBeNil)
|
||||
})
|
||||
Convey("panic when sourceDir does not exist", t, func() {
|
||||
So(func() { test.CopyTestFiles("/path/to/some/unexisting/directory", os.TempDir()) }, ShouldPanic)
|
||||
})
|
||||
}
|
||||
|
||||
func TestGetOciLayoutDigests(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user