Esempio n. 1
0
def test_load_table_with_invalid_table_entry():
    """This LAYERS table has an invalid APPID table entry, which should be
    ignored at the loading stage.
    """
    doc = ezdxf.new("R12")
    entities = list(load_entities(INVALID_TABLE_ENTRY, "TABLES"))
    table = Table()
    table.load(doc, iter(entities[1:-1]))  # without SECTION tags and ENDTAB
    assert len(table) == 0
Esempio n. 2
0
class TestR2010Table(unittest.TestCase):
    def setUp(self):
        self.dwg = DrawingProxy('AC1024')
        self.table = Table(Tags.from_text(AC1024TABLE), self.dwg)

    def test_table_setup(self):
        self.assertEqual(10, len(self.table))

    def test_write(self):
        stream = StringIO()
        self.table.write(stream)
        result = stream.getvalue()
        stream.close()
        self.assertEqual(normlines(AC1024TABLE), normlines(result))

    def test_get_table_entry(self):
        entry = self.table.get('ACAD')
        self.assertEqual('ACAD', entry.dxf.name)
Esempio n. 3
0
def table_ac1024():
    dwg = ezdxf.new('R2010')
    entities = load_section(AC1024TABLE, 'TABLES', dwg.entitydb)
    return Table(entities[1:-1], dwg)  # without SECTION tags and ENDTAB
Esempio n. 4
0
def test_ac1024_load_table():
    doc = ezdxf.new('R2010')
    entities = list(load_entities(AC1024TABLE, 'TABLES', doc))
    table = Table(doc, entities[1:-1])  # without SECTION tags and ENDTAB
    assert 10 == len(table)
Esempio n. 5
0
 def setUp(self):
     self.dwg = DrawingProxy('AC1024')
     self.table = Table(Tags.from_text(AC1024TABLE), self.dwg)
Esempio n. 6
0
def table_ac1024():
    dwg = DrawingProxy('AC1024')
    entities = load_section(AC1024TABLE, 'TABLES', dwg.entitydb)
    return Table(entities[1:-1], dwg)  # without SECTION tags and ENDTAB