def test_strip_header2(self):
test_input_file = io.BytesIO(b"\x46\x2E\x6C\x6F\x61\x64\x2E\x41"
b"\x43\x00\x80\xF9\x06\x00\x07\xB5"
b"\x50\x00\x00\x3B\x20\x4C\x4F\x41"
b"\x44\x45\x52\x20\x66\x6F\x72\x20\x20")
temp_output_path, bytes_count = self.strip_header(
test_input_file, False)
temp_output_file = open(temp_output_path, "rb")
temp_output_file.seek(0, os.SEEK_END)
try:
self.assertEqual(temp_output_file.tell(), 16)
self.assertEqual(bytes_count, 16)
finally:
temp_output_file.close()
os.remove(temp_output_path)
评论列表
文章目录