示例#1
0
def test_is_not_valid():
    photo = Photo(helper.get_file('text.txt'))

    assert not photo.is_valid()
示例#2
0
def test_is_valid():
    photo = Photo(helper.get_file('plain.jpg'))

    assert photo.is_valid()
示例#3
0
def test_pillow_not_loaded():
    photo = Photo(helper.get_file('imghdr-error.jpg'))
    photo.pillow = None

    assert photo.is_valid() == False
示例#4
0
def test_is_valid():
    photo = Photo(helper.get_file('with-location.jpg'))

    assert photo.is_valid()
示例#5
0
def test_is_valid_fallback_using_pillow():
    photo = Photo(helper.get_file('imghdr-error.jpg'))

    assert photo.is_valid()