File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
translation/samples/snippets/hybrid_glossaries Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ def pic_to_text(infile):
5656 # For less dense text, use text_detection
5757 response = client .document_text_detection (image = image )
5858 text = response .full_text_annotation .text
59+ print ("Detected text: {}" .format (text ))
5960
6061 return text
6162 # [END translate_hybrid_vision]
Original file line number Diff line number Diff line change 1313# limitations under the License.
1414
1515import os
16- import re
1716import sys
1817import uuid
1918
2928# VISION TESTS
3029
3130
32- def test_vision_standard_format ():
31+ def test_vision_standard_format (capsys ):
3332 # Generate text using Vision API
34- text = pic_to_text ('resources/standard_format.jpeg' )
33+ pic_to_text ('resources/standard_format.jpeg' )
34+ out , err = capsys .readouterr ()
3535
36- assert re .match (r"This\s?is\s?a\s?test!\s?" , text )
36+ assert 'Detected text:' in out
37+ assert 'test!' in out
3738
3839
3940def test_vision_non_standard_format ():
You can’t perform that action at this time.
0 commit comments