()
| 1904 | |
| 1905 | |
| 1906 | def test_4479(): |
| 1907 | # This passes with pymupdf-1.24.14, fails with pymupdf==1.25.*, passes with |
| 1908 | # pymupdf-1.26.0. |
| 1909 | print() |
| 1910 | path = os.path.normpath(f'{__file__}/../../tests/resources/test_4479.pdf') |
| 1911 | with pymupdf.open(path) as document: |
| 1912 | |
| 1913 | def show(items): |
| 1914 | for item in items: |
| 1915 | print(f' {repr(item)}') |
| 1916 | |
| 1917 | items = document.layer_ui_configs() |
| 1918 | show(items) |
| 1919 | assert items == [ |
| 1920 | {'depth': 0, 'locked': 0, 'number': 0, 'on': 1, 'text': 'layer_0', 'type': 'checkbox'}, |
| 1921 | {'depth': 0, 'locked': 0, 'number': 1, 'on': 1, 'text': 'layer_1', 'type': 'checkbox'}, |
| 1922 | {'depth': 0, 'locked': 0, 'number': 2, 'on': 0, 'text': 'layer_2', 'type': 'checkbox'}, |
| 1923 | {'depth': 0, 'locked': 0, 'number': 3, 'on': 1, 'text': 'layer_3', 'type': 'checkbox'}, |
| 1924 | {'depth': 0, 'locked': 0, 'number': 4, 'on': 1, 'text': 'layer_4', 'type': 'checkbox'}, |
| 1925 | {'depth': 0, 'locked': 0, 'number': 5, 'on': 1, 'text': 'layer_5', 'type': 'checkbox'}, |
| 1926 | {'depth': 0, 'locked': 0, 'number': 6, 'on': 1, 'text': 'layer_6', 'type': 'checkbox'}, |
| 1927 | {'depth': 0, 'locked': 0, 'number': 7, 'on': 1, 'text': 'layer_7', 'type': 'checkbox'}, |
| 1928 | ] |
| 1929 | |
| 1930 | document.set_layer_ui_config(0, pymupdf.PDF_OC_OFF) |
| 1931 | items = document.layer_ui_configs() |
| 1932 | show(items) |
| 1933 | assert items == [ |
| 1934 | {'depth': 0, 'locked': 0, 'number': 0, 'on': 0, 'text': 'layer_0', 'type': 'checkbox'}, |
| 1935 | {'depth': 0, 'locked': 0, 'number': 1, 'on': 1, 'text': 'layer_1', 'type': 'checkbox'}, |
| 1936 | {'depth': 0, 'locked': 0, 'number': 2, 'on': 0, 'text': 'layer_2', 'type': 'checkbox'}, |
| 1937 | {'depth': 0, 'locked': 0, 'number': 3, 'on': 1, 'text': 'layer_3', 'type': 'checkbox'}, |
| 1938 | {'depth': 0, 'locked': 0, 'number': 4, 'on': 1, 'text': 'layer_4', 'type': 'checkbox'}, |
| 1939 | {'depth': 0, 'locked': 0, 'number': 5, 'on': 1, 'text': 'layer_5', 'type': 'checkbox'}, |
| 1940 | {'depth': 0, 'locked': 0, 'number': 6, 'on': 1, 'text': 'layer_6', 'type': 'checkbox'}, |
| 1941 | {'depth': 0, 'locked': 0, 'number': 7, 'on': 1, 'text': 'layer_7', 'type': 'checkbox'}, |
| 1942 | ] |
| 1943 | |
| 1944 | |
| 1945 | def test_4533(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…