Skip to content

Commit

Permalink
Improve test
Browse files Browse the repository at this point in the history
  • Loading branch information
eyalbe4 committed Nov 3, 2024
1 parent f3a04a2 commit e1d0d6b
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion artifactory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3679,9 +3679,20 @@ func TestArtifactoryCopyByBuildPatternAllUsingSpec(t *testing.T) {
cleanArtifactoryTest()
}

// //////
func TestArtifactorySortAndLimit(t *testing.T) {
initArtifactoryTest(t, "")

// We're changing the temp directory, to ensure it is unique for this test,
// and doesn't include temp files from other tests.
// This is for the "testTempDirCleanFromTempFiles" performed towards the end
// of this function.
originalTempDirBase := fileutils.GetTempDirBase()
defer func() {
fileutils.SetTempDirBase(originalTempDirBase)
}()
fileutils.SetTempDirBase("TestArtifactorySortAndLimit")

// Upload all testdata/a/ files
runRt(t, "upload", "testdata/a/(*)", tests.RtRepo1+"/data/{1}")

Expand Down Expand Up @@ -3713,7 +3724,7 @@ func testTempDirCleanFromTempFiles(t *testing.T) {

for _, file := range files {
if !file.IsDir() {
assert.False(t, strings.HasPrefix(file.Name(), prefix),
require.False(t, strings.HasPrefix(file.Name(), prefix),
"Found a file with a name starting with the prefix '%s': %s", prefix, file.Name())
}
}
Expand Down

0 comments on commit e1d0d6b

Please sign in to comment.