Esempio n. 1
0
func TestExifGetDatetimeOsErrorReturnNil(t *testing.T) {
	OsInterfaceMockReturnFile, OsInterfaceMockReturnError =
		os.Open("bad_file")

	if focusfs.ExifGetDatetime(
		&OsInterfaceMock{},
		&ExifInterfaceMock{}, "test") != nil {
		t.Error("bad file should mean nil back")
	}
}
Esempio n. 2
0
func TestExifGetDatetimeHappyPath(t *testing.T) {
	OsInterfaceMockReturnFile, OsInterfaceMockReturnError =
		os.Open("empty_file")
	ExifInterfaceMockReturnExif = &exif.Exif{}
	ExifInterfaceMockReturnError = nil

	if focusfs.ExifGetDatetime(
		&OsInterfaceMock{},
		&ExifInterfaceMock{}, "test") != nil {
		t.Error("Exif data not returns as expected")
	}
}
Esempio n. 3
0
func TestExifGetDatetimeExifErrorReturnsNil(t *testing.T) {
	OsInterfaceMockReturnFile, OsInterfaceMockReturnError =
		os.Open("empty_file")
	ExifInterfaceMockReturnExif = &exif.Exif{}
	ExifInterfaceMockReturnError = errors.New("blah blah blah")

	if focusfs.ExifGetDatetime(
		&OsInterfaceMock{},
		&ExifInterfaceMock{}, "test") != nil {
		t.Error("Bad exif response should return nil")
	}
}