Esempio n. 1
0
def test_setting_source_block_reference_a_second_time_has_no_effect():
    e = DXFEntity()
    insert = Insert()
    e.set_source_block_reference(insert)
    e.set_source_block_reference(Insert())
    assert (e.source_block_reference is
            insert), "source block reference should not change"
Esempio n. 2
0
def test_do_not_copy_source_block_reference():
    e = DXFEntity()
    insert = Insert()
    e.set_source_block_reference(insert)
    copy = e.copy()
    assert copy.has_source_block_reference is False
    assert copy.source_block_reference is None
Esempio n. 3
0
 def insert():
     return Insert.new(dxfattribs={
         'name': 'AXIS',
         'insert': (0, 0, 0),
         'xscale': 1,
         'yscale': 1,
         'zscale': 1,
         'rotation': 0,
     }, doc=doc1), [(0, 0, 0), X_AXIS, Y_AXIS, Z_AXIS]
Esempio n. 4
0
def test_mcount_property():
    insert = Insert.new()
    insert.grid(size=(2, 2), spacing=(10, 10))
    assert insert.mcount == 4

    insert.grid(size=(2, 2), spacing=(10, 0))
    assert insert.mcount == 2

    insert.grid(size=(2, 2), spacing=(0, 10))
    assert insert.mcount == 2

    insert.grid(size=(2, 2), spacing=(0, 0))
    assert insert.mcount == 1
Esempio n. 5
0
 def insert():
     return (
         Insert.new(
             dxfattribs={
                 "name": "AXIS",
                 "insert": (0, 0, 0),
                 "xscale": 1,
                 "yscale": 1,
                 "zscale": 1,
                 "rotation": 0,
             },
             doc=doc1,
         ),
         [(0, 0, 0), X_AXIS, Y_AXIS, Z_AXIS],
     )
Esempio n. 6
0
 def draw_insert(insert: Insert):
     self.draw_entities(insert.attribs)
     # draw_entities() includes the visibility check:
     self.draw_entities(
         insert.virtual_entities(
             skipped_entity_callback=self.skip_entity))
Esempio n. 7
0
def test_setting_source_block_reference_twice_without_exception():
    e = DXFEntity()
    e.set_source_block_reference(Insert())
    e.set_source_block_reference(Insert())
    assert True is True
Esempio n. 8
0
def test_set_source_block_reference():
    e = DXFEntity()
    insert = Insert()
    e.set_source_block_reference(insert)
    assert e.has_source_block_reference is True
    assert e.source_block_reference is insert
Esempio n. 9
0
 def draw_insert(insert: Insert):
     self.draw_entities(insert.attribs)
     # draw_entities() includes the visibility check:
     self.draw_entities(insert.virtual_entities())