Ejemplo 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")
	}
}
Ejemplo 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")
	}
}
Ejemplo 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")
	}
}