Added test cases

pull/41/head
Sahil Verma 2019-07-29 19:09:46 -05:00
parent b167a8c7dd
commit 0c90551f3c
2 changed files with 30 additions and 0 deletions

View File

@ -2858,3 +2858,20 @@ data_stream_layout_kwargs = [
["A.O.P Cornas", ""],
["Domaine Lionnet « Terre Brûlée » 2012", "15 €"],
]
data_multi_params1 = [
["Number of Coils", "Number of Paperclips"],
["5", "3, 5, 4"],
["10", "7, 8, 6"],
["15", "11, 10, 12"],
["20", "15, 13, 14"]
]
data_multi_params2 = [
["Time (drops of water)", "Distance (cm)"],
["1", "10,11,9"],
["2", "29, 31, 30"],
["3", "59, 58, 61"],
["4", "102, 100, 98"],
["5", "122, 125, 127"]
]

View File

@ -297,3 +297,16 @@ def test_table_order():
(1, 2),
(1, 1),
]
def test_multi_params():
df1 = pd.DataFrame(data_multi_params1)
df2 = pd.DataFrame(data_multi_params2)
filename = os.path.join(
testdir, "multi_params.pdf"
)
tables = camelot.read_pdf(filename, pages="all", multi={'2': {"table_regions": ["120, 210, 400, 90"]}},
split_text=True)
assert df1.equals(tables[0].df)
assert df2.equals(tables[1].df)