Exemple #1
0
 def test_get_bytes_from_file_hex(self):
     result = Utility.get_bytes_from_file(Lib.test_resource_dir +
                                          "/HexTestFile.txt")
     self.assertEqual(result, b'\xab\xcd\xef\xff\x10\xff\xaa\xab')
Exemple #2
0
 def test_get_bytes_from_file_str(self):
     result = Utility.get_bytes_from_file(Lib.test_resource_dir +
                                          "/StringTestFile.txt")
     self.assertEqual(result, b'This is a string-test')
Exemple #3
0
 def test_get_bytes_from_file_invalid_header(self):
     with self.assertRaises(SystemExit):
         Utility.get_bytes_from_file(Lib.test_resource_dir +
                                     "/InvalidHeader.txt")
Exemple #4
0
 def test_get_bytes_from_file_invalid_strfile(self):
     with self.assertRaises(SystemExit):
         Utility.get_bytes_from_file(Lib.test_resource_dir +
                                     "/InvalidStringFile.txt")
Exemple #5
0
 def test_get_bytes_from_file_invalid_path(self):
     with self.assertRaises(SystemExit):
         Utility.get_bytes_from_file(Lib.test_resource_dir +
                                     "/NonExistingFile.txt")