This tests fix #2979 and #3001. 2979: identical cell count for each row 3001: no change of global glyph heights
()
| 162 | |
| 163 | |
| 164 | def test_2979(): |
| 165 | """This tests fix #2979 and #3001. |
| 166 | |
| 167 | 2979: identical cell count for each row |
| 168 | 3001: no change of global glyph heights |
| 169 | """ |
| 170 | filename = os.path.join(scriptdir, "resources", "test_2979.pdf") |
| 171 | doc = pymupdf.open(filename) |
| 172 | page = doc[0] |
| 173 | tab = page.find_tables()[0] # extract the table |
| 174 | lengths = set() # stores all row cell counts |
| 175 | for e in tab.extract(): |
| 176 | lengths.add(len(e)) # store number of cells for row |
| 177 | |
| 178 | # test 2979 |
| 179 | assert len(lengths) == 1 |
| 180 | |
| 181 | # test 3001 |
| 182 | assert ( |
| 183 | pymupdf.TOOLS.set_small_glyph_heights() is False |
| 184 | ), f"{pymupdf.TOOLS.set_small_glyph_heights()=}" |
| 185 | |
| 186 | wt = pymupdf.TOOLS.mupdf_warnings() |
| 187 | if pymupdf.mupdf_version_tuple >= (1, 28, 0): |
| 188 | assert ( wt == '' ) |
| 189 | else: |
| 190 | assert ( |
| 191 | wt |
| 192 | == "bogus font ascent/descent values (3117 / -2463)\n... repeated 2 times..." |
| 193 | ) |
| 194 | |
| 195 | |
| 196 | def test_3062(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…