Mercurial > boomslang
diff pyntnclick/tests/test_resources.py @ 580:27809609eeca pyntnclick
Allow different image basedir.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Sat, 11 Feb 2012 16:22:56 +0200 |
parents | 85f1ab8af698 |
children | 96ff2d8a8a9a |
line wrap: on
line diff
--- a/pyntnclick/tests/test_resources.py Sat Feb 11 16:21:20 2012 +0200 +++ b/pyntnclick/tests/test_resources.py Sat Feb 11 16:22:56 2012 +0200 @@ -51,3 +51,14 @@ def test_load_image(self): image = self.res.load_image('pyntnclick/hand.png') self.assertTrue(isinstance(image, Surface)) + + def test_load_image_different_basedir(self): + image = self.res.load_image('hand.png', basedir='images/pyntnclick') + self.assertTrue(isinstance(image, Surface)) + + def test_load_missing(self): + try: + self.res.load_image('should_not_exist') + self.fail('Expected ResourceNotFound error.') + except ResourceNotFound, e: + self.assertEqual('images/should_not_exist', e.args[0])