def test_support_for_proxy_graphic_stored_in_acdb_entity(): tag_storage = factory.load(ExtendedTags.from_text(DXF_STORAGE)) assert tag_storage.dxftype() == "TAG_STORAGE" proxy = DXFGraphicProxy(tag_storage) # reusing data from test suite 252 types = [e.dxftype() for e in query_virtual_entities(proxy)] assert types == [ "POLYLINE", "POLYLINE", "ARC", "ARC", "POLYLINE", "POLYLINE", ]
def test_supports_virtual_entities_protocol(self, parser): assert isinstance(parser, SupportsVirtualEntities) is True assert len(query_virtual_entities(parser)) > 0
def test_supports_virtual_entities_protocol_of_wrapped_entity(self): proxy = DXFGraphicProxy(VirtualEntitiesProtocol()) assert list(query_virtual_entities(proxy)) == ENTITIES
def test_query_virtual_entities(self, insert): entities = query_virtual_entities(insert) assert len(entities) == 1 assert entities[0].dxftype() == "POINT"
def test_supports_virtual_entities_protocol(self, proxy): assert isinstance(proxy, SupportsVirtualEntities) assert len(query_virtual_entities(proxy)) == 0
def test_supports_virtual_entities_protocol(): leader = Leader.new() leader.vertices = VERTICES assert isinstance(leader, SupportsVirtualEntities) assert len(query_virtual_entities(leader)) == 2
def test_supports_virtual_entities_protocol(entity): assert isinstance(entity, SupportsVirtualEntities) is True assert len(query_virtual_entities(entity)) == 0
def test_virtual_entities_from_block(acad_table): content = query_virtual_entities(acad_table) assert len(content) == 42 # Provides real INSERT entities: assert sum(int(e.dxftype() == "INSERT") for e in content) == 1
def test_support_virtual_entities_protocol(self, msp): mline = msp.add_mline([(1, 2, 3), (3, 4, 3)]) assert isinstance(mline, SupportsVirtualEntities) assert len(query_virtual_entities(mline)) > 0
def test_supports_virtual_entities_protocol(dxf2000): dimline = add_linear_dimension(dxf2000) assert isinstance(dimline, SupportsVirtualEntities) is True assert len(query_virtual_entities(dimline)) > 0