Exemple #1
0
def test_get_coordinates_without_exif():
    photo = Photo(helper.get_file('no-exif.jpg'))
    latitude = photo.get_coordinate('latitude')
    longitude = photo.get_coordinate('longitude')

    assert latitude is None, latitude
    assert longitude is None, longitude
Exemple #2
0
def test_get_coordinates_with_null_coordinate():
    photo = Photo(helper.get_file('with-null-coordinates.jpg'))
    latitude = photo.get_coordinate('latitude')
    longitude = photo.get_coordinate('longitude')

    assert latitude is None, latitude
    assert longitude is None, longitude
Exemple #3
0
def test_get_coordinates_with_zero_coordinate():
    photo = Photo(helper.get_file('with-location-zero-coordinate.jpg'))
    latitude = photo.get_coordinate('latitude')
    longitude = photo.get_coordinate('longitude')

    assert helper.isclose(latitude, 51.55325), latitude
    assert helper.isclose(longitude, -0.00417777777778), longitude
Exemple #4
0
def test_get_coordinate_longitude_plus():
    photo = Photo(helper.get_file('with-location-inv.jpg'))
    coordinate = photo.get_coordinate('longitude')

    assert helper.isclose(coordinate,122.033383611), coordinate
Exemple #5
0
def test_get_coordinate_latitude_minus():
    photo = Photo(helper.get_file('with-location-inv.jpg'))
    coordinate = photo.get_coordinate('latitude')

    assert helper.isclose(coordinate,-37.3667027222), coordinate
Exemple #6
0
def test_get_coordinate_default():
    photo = Photo(helper.get_file('with-location.jpg'))
    coordinate = photo.get_coordinate()

    assert helper.isclose(coordinate,37.3667027222), coordinate
Exemple #7
0
def test_get_coordinate_longitude():
    photo = Photo(helper.get_file('with-location.jpg'))
    coordinate = photo.get_coordinate('longitude')

    assert coordinate == -122.033383611, coordinate
Exemple #8
0
def test_get_coordinate_latitude():
    photo = Photo(helper.get_file('with-location.jpg'))
    coordinate = photo.get_coordinate('latitude')

    assert coordinate == 37.3667027222, coordinate
Exemple #9
0
def test_get_coordinate_longitude():
    photo = Photo(helper.get_file("with-location.jpg"))
    coordinate = photo.get_coordinate("longitude")

    assert coordinate == -122.033383611, coordinate
Exemple #10
0
def test_get_coordinate_latitude():
    photo = Photo(helper.get_file("with-location.jpg"))
    coordinate = photo.get_coordinate("latitude")

    assert coordinate == 37.3667027222, coordinate