@pytest.mark.docker
def test_file_operations(tmp_path: Path):
    with DockerContainer(DEFAULT_IMAGE) as container:
        test_binary_data = bytes((random.randrange(256) for _ in range(1000)))
        original_test_file = (tmp_path / 'test.dat')
        original_test_file.write_bytes(test_binary_data)
        dst_file = PurePath('/tmp/test.dat')
        container.copy_into(original_test_file, dst_file)
        output = container.call(['cat', dst_file], capture_output=True)
        assert (test_binary_data == bytes(output, encoding='utf8', errors='surrogateescape'))
@pytest.mark.docker
def test_file_operations(tmp_path: Path):
    with DockerContainer(DEFAULT_IMAGE) as container:
        test_binary_data = bytes((random.randrange(256) for _ in range(1000)))
        original_test_file = (tmp_path / 'test.dat')
        original_test_file.write_bytes(test_binary_data)
        dst_file = PurePath('/tmp/test.dat')
        container.copy_into(original_test_file, dst_file)
        output = container.call(['cat', dst_file], capture_output=True)
        assert (test_binary_data == bytes(output, encoding='utf8', errors='surrogateescape'))