added tests for the filescanner using a testimage
This commit is contained in:
parent
8efd309a9c
commit
21a3e08478
@ -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
BIN
test/testimage.jpg
Executable file
Binary file not shown.
After Width: | Height: | Size: 4.5 MiB |
Loading…
Reference in New Issue
Block a user