@@ -59,6 +59,14 @@ def test_password():
59
59
assert_frame_equal (df , tables [0 ].df )
60
60
61
61
62
+ def test_repr_pdfium ():
63
+ filename = os .path .join (testdir , "foo.pdf" )
64
+ tables = camelot .read_pdf (filename , backend = "pdfium" )
65
+ assert repr (tables ) == "<TableList n=1>"
66
+ assert repr (tables [0 ]) == "<Table shape=(7, 7)>"
67
+ assert repr (tables [0 ].cells [0 ][0 ]) == "<Cell x1=121 y1=218 x2=165 y2=234>"
68
+
69
+
62
70
def test_repr_poppler ():
63
71
filename = os .path .join (testdir , "foo.pdf" )
64
72
tables = camelot .read_pdf (filename , backend = "poppler" )
@@ -76,6 +84,14 @@ def test_repr_ghostscript():
76
84
assert repr (tables [0 ].cells [0 ][0 ]) == "<Cell x1=120 y1=218 x2=165 y2=234>"
77
85
78
86
87
+ def test_url_pdfium ():
88
+ url = "https://camelot-py.readthedocs.io/en/master/_static/pdf/foo.pdf"
89
+ tables = camelot .read_pdf (url , backend = "pdfium" )
90
+ assert repr (tables ) == "<TableList n=1>"
91
+ assert repr (tables [0 ]) == "<Table shape=(7, 7)>"
92
+ assert repr (tables [0 ].cells [0 ][0 ]) == "<Cell x1=121 y1=218 x2=165 y2=234>"
93
+
94
+
79
95
def test_url_poppler ():
80
96
url = "https://camelot-py.readthedocs.io/en/master/_static/pdf/foo.pdf"
81
97
tables = camelot .read_pdf (url , backend = "poppler" )
@@ -93,6 +109,24 @@ def test_url_ghostscript():
93
109
assert repr (tables [0 ].cells [0 ][0 ]) == "<Cell x1=120 y1=218 x2=165 y2=234>"
94
110
95
111
112
+ def test_pages_pdfium ():
113
+ url = "https://camelot-py.readthedocs.io/en/master/_static/pdf/foo.pdf"
114
+ tables = camelot .read_pdf (url , backend = "pdfium" )
115
+ assert repr (tables ) == "<TableList n=1>"
116
+ assert repr (tables [0 ]) == "<Table shape=(7, 7)>"
117
+ assert repr (tables [0 ].cells [0 ][0 ]) == "<Cell x1=121 y1=218 x2=165 y2=234>"
118
+
119
+ tables = camelot .read_pdf (url , pages = "1-end" , backend = "pdfium" )
120
+ assert repr (tables ) == "<TableList n=1>"
121
+ assert repr (tables [0 ]) == "<Table shape=(7, 7)>"
122
+ assert repr (tables [0 ].cells [0 ][0 ]) == "<Cell x1=121 y1=218 x2=165 y2=234>"
123
+
124
+ tables = camelot .read_pdf (url , pages = "all" , backend = "pdfium" )
125
+ assert repr (tables ) == "<TableList n=1>"
126
+ assert repr (tables [0 ]) == "<Table shape=(7, 7)>"
127
+ assert repr (tables [0 ].cells [0 ][0 ]) == "<Cell x1=121 y1=218 x2=165 y2=234>"
128
+
129
+
96
130
def test_pages_poppler ():
97
131
url = "https://camelot-py.readthedocs.io/en/master/_static/pdf/foo.pdf"
98
132
tables = camelot .read_pdf (url , backend = "poppler" )
0 commit comments