def test_update_depth(self): theme = Theme({'first depth': { 'second depth': [0, 0, 0, 0] }}, 'some_path') update = {'first depth': {'other second depth': [1, 1, 1, 1]}} theme.update(update) # test that theme was updated path = ['first depth', 'other second depth'] self.assertEqual(theme[path], [1, 1, 1, 1])
def test_update_with_texture(self): theme = Theme({'first depth': {'image': 'panel.png'}}, 'theme') update = {'first depth': {'image': {'source': 'panel.png', 'region': [0, 0, 16, 16]} } } theme.update(update) # update is to a 16x16 image. self.assertEqual(theme['first depth']['image'].width, 16) self.assertEqual(theme['first depth']['image'].height, 16)
def test_update_with_texture(self): theme = Theme({'first depth': {'image': 'panel.png'}}, 'theme') update = { 'first depth': { 'image': { 'source': 'panel.png', 'region': [0, 0, 16, 16] } } } theme.update(update) # update is to a 16x16 image. self.assertEqual(theme['first depth']['image'].width, 16) self.assertEqual(theme['first depth']['image'].height, 16)