Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_image_to_data__pandas_support(test_file):
with pytest.raises(TSVNotSupported):
image_to_data(test_file, output_type=Output.DATAFRAME)
def test_image_to_data__pandas_output(test_file):
"""Test and compare the type and meta information of the result."""
result = image_to_data(test_file, output_type=Output.DATAFRAME)
assert isinstance(result, pandas.DataFrame)
expected_columns = [
'level', 'page_num', 'block_num', 'par_num', 'line_num', 'word_num',
'left', 'top', 'width', 'height', 'conf', 'text'
]
assert bool(set(result.columns).intersection(expected_columns))