/usr/lib/python2.7/dist-packages/openpyxl/worksheet/tests/test_pagebreak.py is in python-openpyxl 2.4.9-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | from __future__ import absolute_import
# Copyright (c) 2010-2017 openpyxl
import pytest
from openpyxl.tests.helper import compare_xml
from openpyxl.xml.functions import tostring
@pytest.fixture
def Break():
from ..pagebreak import Break
return Break
@pytest.fixture
def PageBreak():
from ..pagebreak import PageBreak
return PageBreak
class TestBreak:
def test_ctor(self, Break):
brk = Break()
assert dict(brk) == {'id': '0', 'man': '1', 'max': '16383', 'min': '0'}
xml = tostring(brk.to_tree())
expected = """
<brk id="0" man="1" max="16383" min="0"></brk>
"""
diff = compare_xml(xml, expected)
assert diff is None, diff
class TestPageBreak:
def test_no_brks(self, PageBreak):
pb = PageBreak()
assert dict(pb) == {'count': '0', 'manualBreakCount': '0'}
def test_brk(self, PageBreak):
pb = PageBreak()
pb.append()
assert dict(pb) == {'count': '1', 'manualBreakCount': '1'}
xml = tostring(pb.to_tree())
expected = """
<rowBreaks count="1" manualBreakCount="1">
<brk id="1" man="1" max="16383" min="0"></brk>
</rowBreaks>
"""
diff = compare_xml(xml, expected)
assert diff is None, diff
|