def testNameUpdate(self): icon = Icon("/path/to/file123.jpg") self.assertEqual(icon.name, "file123") icon.path = "/other/path/imageFoo" self.assertNotEqual(icon.name, "imageFoo") icon.updateName() self.assertEqual(icon.name, "imageFoo") icon.path = "/another/iMg.gif" icon.updateName() self.assertEqual(icon.name, "iMg") self.assertEqual(icon.path, "/another/iMg.gif")
def testIconCorrect(self): icon = Icon("path/to/file.png") self.assertFalse(icon.isCorrect()) icon.path = "blank.svg" self.assertTrue(icon.isCorrect())