Skip to content

Commit 2df25e7

Browse files
sverma25bosd
authored andcommitted
Added test cases
1 parent 78ad663 commit 2df25e7

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

tests/data.py

+17
Original file line numberDiff line numberDiff line change
@@ -3263,3 +3263,20 @@
32633263
["", "", "", "", "", "Test Average =", "47.6", "7.7", "0", "122.9", "$713"],
32643264
["", "", "", "", "", "LSD (0.10) =", "5.7", "0.3", "ns", "37.8", "566.4"],
32653265
]
3266+
3267+
data_multi_params1 = [
3268+
["Number of Coils", "Number of Paperclips"],
3269+
["5", "3, 5, 4"],
3270+
["10", "7, 8, 6"],
3271+
["15", "11, 10, 12"],
3272+
["20", "15, 13, 14"]
3273+
]
3274+
3275+
data_multi_params2 = [
3276+
["Time (drops of water)", "Distance (cm)"],
3277+
["1", "10,11,9"],
3278+
["2", "29, 31, 30"],
3279+
["3", "59, 58, 61"],
3280+
["4", "102, 100, 98"],
3281+
["5", "122, 125, 127"]
3282+
]

tests/test_common.py

+13
Original file line numberDiff line numberDiff line change
@@ -214,3 +214,16 @@ def _make_table(page, order):
214214
assert iterator_b is not None
215215
item_c = next(iterator_b)
216216
assert item_c is not None
217+
218+
def test_multi_params(testdir):
219+
df1 = pd.DataFrame(data_multi_params1)
220+
df2 = pd.DataFrame(data_multi_params2)
221+
222+
filename = os.path.join(
223+
testdir, "multi_params.pdf"
224+
)
225+
tables = camelot.read_pdf(filename, pages="all", multi={'2': {"table_regions": ["120, 210, 400, 90"]}},
226+
split_text=False)
227+
228+
assert df1.equals(tables[0].df)
229+
assert df2.equals(tables[1].df)

0 commit comments

Comments
 (0)