Beispiel #1
0
    def test_listcolumn_container(self):
        c = ListColumnContainer(columns=2,
                                items=[self.w2, self.w3, self.w5],
                                columns_width=10,
                                spacing=2,
                                numbering=False)
        c.render(25)

        expected_result = [u"Test        Test 3", u"Test 2"]
        res_lines = c.get_lines()
        self.evaluate_result(res_lines, expected_result)
Beispiel #2
0
    def test_column_numbering(self):
        # spacing is 3 by default
        c = ListColumnContainer(2, [self.w1, self.w2, self.w3, self.w4],
                                columns_width=16)
        c.render(25)

        expected_result = [
            u"1) Můj krásný      3) Test 2", u"   dlouhý text",
            u"2) Test            4) Krásný dlouhý",
            u"                      text podruhé"
        ]
        res_lines = c.get_lines()
        self.evaluate_result(res_lines, expected_result)
    def test_listcolumn_wrapping(self):
        # spacing is 3 by default
        c = ListColumnContainer(2, [self.w1, self.w2, self.w3, self.w4],
                                columns_width=15,
                                numbering=False)
        c.render(25)

        expected_result = [
            "Můj krásný        Test 2", "dlouhý text",
            "Test              Krásný dlouhý", "                  text podruhé"
        ]
        res_lines = c.get_lines()
        self.evaluate_result(res_lines, expected_result)