-
-def test_load():
- for fixture in get_all_fixtures('picture', '*.xml'):
- yield check_load, fixture
-
-
-def test_wlpicture():
- wlp = picture.WLPicture.from_file(open(get_fixture('picture', 'angelus-novus.xml')))
- pi = wlp.picture_info
-
- # from nose.tools import set_trace; set_trace()
- assert pi.type[0] == u"Image"
- assert pi.mime_type == u'image/jpeg' == wlp.mime_type
- assert wlp.slug == 'angelus-novus'
-
- assert path.exists(wlp.image_path)
+ def test_load(self):
+ for fixture in get_all_fixtures('picture', '*.xml'):
+ with self.subTest(fixture=fixture):
+ self.check_load(fixture)
+
+ def test_wlpicture(self):
+ with open(get_fixture('picture', 'angelus-novus.xml')) as f:
+ wlp = picture.WLPicture.from_file(f)
+ pi = wlp.picture_info
+
+ self.assertEqual(pi.type[0], "Image")
+ self.assertEqual(pi.mime_type, 'image/jpeg')
+ self.assertEqual(wlp.mime_type, 'image/jpeg')
+ self.assertEqual(wlp.slug, 'angelus-novus')
+ self.assertTrue(path.exists(wlp.image_path))