Пример #1
0
 def test_name_invalid(self):
     image = Image()
     try:
         image.name = "myname.ext"
         self.fail("Should have raised exception")
     except InvalidImageError as e:
         self.assertTrue(type(e) is InvalidImageError)
Пример #2
0
 def test_uppercase_image(self):
     image = Image()
     image.name = "MyPic.PNG"
     self.assertEqual(image.type, "png")
     self.assertEqual(image.kind, Constants.IMAGE_KIND)
     self.assertEqual(image.name, "MyPic.PNG")
Пример #3
0
 def test_jpeg_image(self):
     image = Image()
     image.name = "image.jpeg"
     self.assertEqual(image.type, "jpeg")
     self.assertEqual(image.kind, Constants.IMAGE_KIND)
     self.assertEqual(image.name, "image.jpeg")