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:
Nicol
2023-02-02 21:39:03 +02:00
committed by GitHub
parent 863d057e43
commit ba3f6f7492
4 changed files with 11 additions and 24 deletions
+2 -1
View File
@@ -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)