示例#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')
示例#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')
示例#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")
示例#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")
示例#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")