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')
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')
def test_get_bytes_from_file_invalid_header(self): with self.assertRaises(SystemExit): Utility.get_bytes_from_file(Lib.test_resource_dir + "/InvalidHeader.txt")
def test_get_bytes_from_file_invalid_strfile(self): with self.assertRaises(SystemExit): Utility.get_bytes_from_file(Lib.test_resource_dir + "/InvalidStringFile.txt")
def test_get_bytes_from_file_invalid_path(self): with self.assertRaises(SystemExit): Utility.get_bytes_from_file(Lib.test_resource_dir + "/NonExistingFile.txt")