def test_write(self, tags): stream = StringIO() tagwriter = TagWriter(stream) tagwriter.write_tags(tags) result = stream.getvalue() stream.close() assert TEST_TAGREADER == result
def test_write(self): stream = StringIO() tagwriter = TagWriter(stream) tagwriter.write_tags(self.tags) result = stream.getvalue() stream.close() self.assertEqual(TEST_TAGREADER, result)
def test_group_code_1000_outside_XDATA(): tags = ExtendedTags(Tags.from_text(BLOCKBASEPOINTPARAMETER_CVIL_3D_2018)) assert tags.dxftype() == 'BLOCKBASEPOINTPARAMETER' assert len(tags.subclasses) == 6 block_base_point_parameter = tags.get_subclass('AcDbBlockBasepointParameter') assert len(block_base_point_parameter) == 3 assert block_base_point_parameter[0] == (100, 'AcDbBlockBasepointParameter') assert block_base_point_parameter[1] == (1011, (0., 0., 0.)) assert block_base_point_parameter[2] == (1012, (0., 0., 0.)) block_element = tags.get_subclass('AcDbBlockElement') assert block_element[4] == (1071, 0) stream = StringIO() tagwriter = TagWriter(stream) tagwriter.write_tags(tags) lines = stream.getvalue() stream.close() assert len(lines.split('\n')) == len(BLOCKBASEPOINTPARAMETER_CVIL_3D_2018.split('\n'))
def test_copy(xtags1): stream = StringIO() tagwriter = TagWriter(stream) tagwriter.write_tags(xtags1) assert XTAGS1 == stream.getvalue() stream.close()