comparison pyntnclick/tests/test_resources.py @ 571:20e296d4a3a5 pyntnclick

Add load_image to Resources.
author Jeremy Thurgood <firxen@gmail.com>
date Sat, 11 Feb 2012 15:48:04 +0200
parents f22953c43c6d
children 85f1ab8af698
comparison
equal deleted inserted replaced
570:9c3528c2cbe5 571:20e296d4a3a5
1 import os.path 1 import os.path
2 from unittest import TestCase 2 from unittest import TestCase
3
4 from pygame.surface import Surface
3 5
4 from pyntnclick.resources import Resources, ResourceNotFound 6 from pyntnclick.resources import Resources, ResourceNotFound
5 7
6 8
7 TEST_PATH = os.path.dirname(__file__) 9 TEST_PATH = os.path.dirname(__file__)
38 40
39 def test_get_resource_path_in_data(self): 41 def test_get_resource_path_in_data(self):
40 res = Resources('pyntnclick.tests') 42 res = Resources('pyntnclick.tests')
41 self.assertEqual(data_path('images/pyntnclick/hand.png'), 43 self.assertEqual(data_path('images/pyntnclick/hand.png'),
42 res.get_resource_path('images/pyntnclick/hand.png')) 44 res.get_resource_path('images/pyntnclick/hand.png'))
45
46 def test_load_image(self):
47 res = Resources('pyntnclick.tests')
48 res.CONVERT_ALPHA = False
49 image = res.load_image('pyntnclick/hand.png')
50 self.assertTrue(isinstance(image, Surface))