Beispiel #1
0
 def execute(self):
     with open(self._input_file, 'rb') as png_file:
         with open(self._output_file, 'wb') as data_file:
             pixels = read_pixels_from_png(png_file)
             write_data_to_file(convert_pixels_to_bytes(pixels), data_file)
Beispiel #2
0
 def execute(self):
     with open(self._input_file, 'rb') as png_file:
         with open(self._output_file, 'wb') as data_file:
             pixels = read_pixels_from_png(png_file)
             write_data_to_file(convert_pixels_to_bytes(pixels), data_file)
Beispiel #3
0
def test_write_data_produces_expected_output():
    data = bytearray.fromhex('ffffe3990012')
    file = io.BytesIO()
    write_data_to_file(data, file)

    assert file.getvalue() == data