Exemplo n.º 1
0
 def test_make_rotation(self):
     original = Paper(*[Mm(val) for val in [100, 101, 1, 2, 3, 4, 5]])
     rotated = original.make_rotation()
     assert rotated.width == original.height
     assert rotated.height == original.width
     assert rotated.margin_top == original.margin_left
     assert rotated.margin_right == original.margin_top
     assert rotated.margin_bottom == original.margin_right
     assert rotated.margin_left == original.margin_bottom
     assert rotated.gutter == original.gutter
Exemplo n.º 2
0
 def test_page_origin_at_first_page(self):
     left_margin = Mm(13)
     top_margin = Mm(21)
     test_paper = Paper(Mm(200), Mm(250), top_margin, Mm(10), Mm(20),
                        left_margin, Mm(0))
     test_doc = Document(test_paper)
     found = test_doc.page_origin(0)
     assert_almost_equal(found, Point(left_margin, top_margin))
Exemplo n.º 3
0
 def test_init(self):
     test_paper = Paper(*[Mm(val) for val in [1, 2, 3, 4, 5, 6, 7]])
     assert test_paper.width == Mm(1)
     assert test_paper.height == Mm(2)
     assert test_paper.margin_top == Mm(3)
     assert test_paper.margin_right == Mm(4)
     assert test_paper.margin_bottom == Mm(5)
     assert test_paper.margin_left == Mm(6)
     assert test_paper.gutter == Mm(7)
Exemplo n.º 4
0
 def test_page_origin_at_second_page(self):
     width = Mm(200)
     left_margin = Mm(13)
     top_margin = Mm(21)
     test_paper = Paper(width, Mm(250), top_margin, Mm(10), Mm(20),
                        left_margin, Mm(0))
     test_doc = Document(test_paper)
     found = test_doc.page_origin(1)
     page_width = width
     expected_x = left_margin + page_width + test_doc._page_display_gap
     expected_y = top_margin
     assert_almost_equal(found, Point(expected_x, expected_y))
Exemplo n.º 5
0
 def setUp(self):
     neoscore.setup(Paper(*[Mm(val) for val in [210, 297, 20, 20, 20, 20, 10]]))
     self.flowable = Flowable((Mm(0), Mm(0)), Mm(10000), Mm(30), Mm(5))
     self.staff = Staff((Mm(0), Mm(0)), Mm(5000), self.flowable)
Exemplo n.º 6
0
 def test_init_with_explicit_paper(self):
     test_paper = Paper(Mm(200), Mm(250), Mm(20), Mm(10), Mm(20), Mm(10),
                        Mm(5))
     test_doc = Document(test_paper)
     assert test_doc.paper == test_paper
Exemplo n.º 7
0
 def test_live_height(self):
     test_paper = Paper(*[Mm(val) for val in [210, 297, 20, 30, 20, 30, 15]])
     assert test_paper.live_height == Mm(297 - 20 - 20)
Exemplo n.º 8
0
 def test_live_width(self):
     test_paper = Paper(*[Mm(val) for val in [210, 297, 20, 30, 20, 30, 15]])
     assert test_paper.live_width == Mm(210 - 30 - 30 - 15)
Exemplo n.º 9
0
 def setUp(self):
     neoscore.setup(
         Paper(*[Mm(val) for val in [210, 297, 20, 20, 20, 20, 10]]))