Пример #1
0
    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])
Пример #2
0
    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])
Пример #3
0
    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)
Пример #4
0
    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)