Esempio n. 1
0
 def test_key_error(self, caplog):
     d = style.ColorDict()
     with caplog.atLevel(logging.ERROR):
         d['foo']  # pylint: disable=pointless-statement
     records = caplog.records()
     assert len(records) == 1
     assert records[0].message == 'No color defined for foo!'
Esempio n. 2
0
 def test_values(self, key, expected):
     d = style.ColorDict()
     d['foo'] = 'one'
     d['foo.fg'] = 'two'
     d['foo.bg'] = 'three'
     assert d[key] == expected
Esempio n. 3
0
 def test_qcolor(self):
     d = style.ColorDict()
     d['foo'] = QColor()
     with pytest.raises(TypeError):
         d['foo']  # pylint: disable=pointless-statement