added tests for the filescanner using a testimage

This commit is contained in:
Philipp Häfelfinger 2019-03-23 22:05:25 +01:00
parent 8efd309a9c
commit 21a3e08478
2 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,22 @@
package localFileStructure
import "testing"
func Test_ScanLocalFileStructure_should_find_testfile(t *testing.T) {
images, err := ScanLocalFileStructure("../../../test/")
if err != nil {
t.Fatal(err)
}
if len(images) != 1 {
t.Error("Did not find expected testfiles. Expected at least one!")
}
for _, img := range images {
if img.Name != "testimage.jpg" {
t.Errorf("Did not find the expected testimage.")
}
}
}

BIN
test/testimage.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 MiB