Esempio n. 1
0
    def test_wrong_input(self):

        things = [1, None, 3.1415, QWidget(), [1, 2, 3]]

        # Most things are not changed
        for thing in things:
            with self.assertRaises((ValueError, TypeError)):
                _ = _process_font(thing)
Esempio n. 2
0
    def test_list_partial_args(self):

        lst = ['arial', 12, 3, True]

        for n in range(len(lst)):
            assert _process_font(lst[:n]) == QFont(*lst[:n])
Esempio n. 3
0
    def test_tuple_partial_args(self):

        t = ('arial', 12, 3, True)

        for n in range(len(t)):
            assert _process_font(t[:n]) == QFont(*t[:n])
Esempio n. 4
0
    def test_family_str(self):

        family = 'Arial'
        assert _process_font(family) == QFont('Arial')
Esempio n. 5
0
    def test_qfont_is_not_changed(self):

        f = QFont('Arial')
        assert _process_font(f) is f
Esempio n. 6
0
    def test_underscore_is_not_changed(self):

        assert _process_font(_) is _