def test_create_and_open(writable_filename): test_save(writable_filename) pack = ZipPackage.from_file(writable_filename) assert '/test/part.xml' in pack part = pack['/test/part.xml'] assert part.data == '<test>hi there</test>'.encode('ascii') rendered_children = io.StringIO() out = six.text_type(pack.relationships.children) print(out, file=rendered_children) relations = pack.related('http://polimetrix.com/relationships/test') assert len(relations) == 1 assert relations[0] == part
def test_create_package_from_existing_file(zippack_sample_filename): pack = ZipPackage.from_file(zippack_sample_filename)