mirror of
https://github.com/project-zot/zot.git
synced 2026-06-16 04:17:55 +08:00
fix(test): update the zot tests not to use test/data as rootDir (use a temporary folder instead) (#1162)
Signed-off-by: Nicol Draghici <idraghic@cisco.com>
This commit is contained in:
@@ -42,8 +42,9 @@ func TestCommon(t *testing.T) {
|
||||
Convey("test dirExists()", t, func() {
|
||||
exists := common.DirExists("testdir")
|
||||
So(exists, ShouldBeFalse)
|
||||
tempDir := t.TempDir()
|
||||
|
||||
file, err := os.Create("file.txt")
|
||||
file, err := os.Create(path.Join(tempDir, "file.txt"))
|
||||
So(err, ShouldBeNil)
|
||||
isDir := common.DirExists(file.Name())
|
||||
So(isDir, ShouldBeFalse)
|
||||
|
||||
Reference in New Issue
Block a user