Skip to content

Commit

Permalink
Merge pull request #20 from redcanari/fix-unittests-for-portability
Browse files Browse the repository at this point in the history
Made unittest portable for Windows
  • Loading branch information
allfro committed Jun 5, 2017
2 parents e390b93 + eb018e4 commit 964e5eb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/canari/unittests/test_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ResourceTests(TestCase):

def test_external_resource(self):
resource = external_resource('wordlist.txt', 'canari.unittests.resources')
self.assertTrue(resource.endswith('canari/unittests/resources/wordlist.txt'))
self.assertTrue(resource.endswith(os.path.join('canari', 'unittests', 'resources', 'wordlist.txt')))
self.assertTrue(os.path.lexists(resource))

def test_icon_resource(self):
Expand All @@ -29,8 +29,8 @@ def test_image_resources(self):
images = image_resources('canari.unittests')
self.assertTrue(images)
self.assertTrue(len(images) == 4)
for i, j in enumerate(images):
self.assertTrue(j.endswith('canari/unittests/resources/images/%d.png' % i))
for i, j in enumerate(sorted(images)):
self.assertTrue(j.endswith(os.path.join('canari', 'unittests', 'resources', 'images', '%d.png' % i)))
self.assertTrue(os.path.lexists(j))

def test_conf(self):
Expand Down

0 comments on commit 964e5eb

Please sign in to comment.