Beispiel #1
0
def test_vision_standard_format():

    expected_text = 'This is\na test!\n'
    alt_expected_text = 'This\nis\na test!\n'

    # Generate text using Vision API
    text = pic_to_text('resources/standard_format.jpeg')

    assert (text == expected_text) or (text == alt_expected_text)
def test_vision_non_standard_format():

    # Generate text
    text = pic_to_text('resources/non_standard_format.png')

    # Read expected text
    with open('resources/non_standard_format.txt') as f:
        expected_text = f.read()

    assert text == expected_text
Beispiel #3
0
def test_vision_standard_format():
    # Generate text using Vision API
    text = pic_to_text('resources/standard_format.jpeg')

    assert len(text) > 0
def test_vision_standard_format():
    # Generate text using Vision API
    text = pic_to_text('resources/standard_format.jpeg')

    assert re.match(r"This\s?is\s?a\s?test!\s?", text)