コード例 #1
0
ファイル: test_table.py プロジェクト: oiesis/agate
    def test_print_bars_width_overlap(self):
        table = Table(self.rows, self.columns)

        output = six.StringIO()
        table.print_bars('three', 'one', width=20, output=output)
        lines = output.getvalue().split('\n')

        self.assertEqual(max([len(l) for l in lines]), 20)
コード例 #2
0
ファイル: test_table.py プロジェクト: wpdavis/agate
    def test_print_bars_width_overlap(self):
        table = Table(self.rows, self.columns)

        output = six.StringIO()
        table.print_bars('three', 'one', width=20, output=output)
        lines = output.getvalue().split('\n')

        self.assertEqual(max([len(l) for l in lines]), 20)
コード例 #3
0
ファイル: test_table.py プロジェクト: oiesis/agate
    def test_print_bars_mixed_signs(self):
        rows = (
            ('-1.7', 2, 'a'),
            ('11.18', None, None),
            ('0', 1, 'c')
        )

        table = Table(rows, self.columns)
        table.print_bars('three', 'one')
コード例 #4
0
ファイル: test_table.py プロジェクト: oiesis/agate
    def test_print_bars_invalid_values(self):
        table = Table(self.rows, self.columns)

        with self.assertRaises(DataTypeError):
            table.print_bars('one', 'three')
コード例 #5
0
ファイル: test_table.py プロジェクト: oiesis/agate
    def test_print_bars_domain_invalid(self):
        table = Table(self.rows, self.columns)

        with self.assertRaises(ValueError):
            table.print_bars('three', 'one', domain=(5, 0))
コード例 #6
0
ファイル: test_table.py プロジェクト: oiesis/agate
    def test_print_bars_domain(self):
        table = Table(self.rows, self.columns)

        table.print_bars('three', 'one', domain=(0, 300))
コード例 #7
0
ファイル: test_table.py プロジェクト: oiesis/agate
    def test_print_bars(self):
        table = Table(self.rows, self.columns)

        output = six.StringIO()
        table.print_bars('three', 'one', output=output)
        lines = output.getvalue().split('\n')
コード例 #8
0
ファイル: test_table.py プロジェクト: wpdavis/agate
    def test_print_bars_invalid_values(self):
        table = Table(self.rows, self.columns)

        with self.assertRaises(DataTypeError):
            table.print_bars('one', 'three')
コード例 #9
0
ファイル: test_table.py プロジェクト: wpdavis/agate
    def test_print_bars_mixed_signs(self):
        rows = (('-1.7', 2, 'a'), ('11.18', None, None), ('0', 1, 'c'))

        table = Table(rows, self.columns)
        table.print_bars('three', 'one')
コード例 #10
0
ファイル: test_table.py プロジェクト: wpdavis/agate
    def test_print_bars_domain_invalid(self):
        table = Table(self.rows, self.columns)

        with self.assertRaises(ValueError):
            table.print_bars('three', 'one', domain=(5, 0))
コード例 #11
0
ファイル: test_table.py プロジェクト: wpdavis/agate
    def test_print_bars_domain(self):
        table = Table(self.rows, self.columns)

        table.print_bars('three', 'one', domain=(0, 300))
コード例 #12
0
ファイル: test_table.py プロジェクト: wpdavis/agate
    def test_print_bars(self):
        table = Table(self.rows, self.columns)

        output = six.StringIO()
        table.print_bars('three', 'one', output=output)
        lines = output.getvalue().split('\n')