示例#1
0
 def test_load_from_path(self):
     collie_path = "./tests/examples/collie.jpg"
     target_file = TargetFile(collie_path)
     self.assertEqual(target_file.get_extension(), ".jpg")
     self.assertTrue("JPEG" in target_file.get_type())
     self.assertEqual(target_file.get_name(), "collie.jpg")
     self.assertEqual(len(target_file.get_binary()), 19863)
     self.assertEqual(target_file.get_path(), collie_path)
     self.assertEqual(target_file.get_directory(), "./tests/examples")
     self.assertEqual(target_file.get_info()["extension"],
                      target_file.get_extension())
示例#2
0
 def test_load_without_extension(self):
     collie_path = "./tests/examples/NOEXTENSION"
     target_file = TargetFile(collie_path)
     self.assertEqual(target_file.get_extension(), "")
     self.assertTrue("ASCII" in target_file.get_type())