Exemple #1
0
 def test_initialization(self):
     outline = Outline(2, '#111')
     text = Text('foo', Font(), '#000', outline)
     self.assertEqual(text.text, 'foo')
     self.assertIsNotNone(text.font)
     self.assertEqual(text.color, (0, 0, 0))
     self.assertEqual(text.outline, outline)
Exemple #2
0
 def test_setting_color_with_color_provided(self):
     Text._set_color(self.text_mock, '#000')
     self.assertEqual(self.text_mock.color, (0, 0, 0))
Exemple #3
0
 def test_setting_color_without_color(self):
     Text._set_color(self.text_mock, None)
     self.assertIsNone(self.text_mock.color)
Exemple #4
0
 def test_setting_text(self):
     Text._set_text(self.text_mock, 'foo')
     self.assertEqual(self.text_mock.text, 'foo')