def test_dxf_creation(self): self.reset_counter() table = Table((0, 0), 3, 3) indices = [(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2), (2, 0), (2, 1), (2, 2)] cell = UserCell(table, 'default', (1, 1)) for row, col in indices: table.set_cell(row, col, cell) dxfstr(table) dxfmock = DXFMock() self.assertEqual(cell.counter, 9) # count get_dxf_entity calls self.assertEqual(cell.counter, dxfmock.counter)
def test_dxf_creation(self): self.reset_counter() table = Table((0, 0), 3, 3) indices = [(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2), (2, 0), (2, 1), (2, 2)] cell = TestCell(table, 'default', (1, 1)) for row, col in indices: table.set_cell(row, col, cell) dxfstr(table) dxfmock = DXFMock() self.assertEqual(cell.counter, 9) # count get_dxf_entity calls self.assertEqual(cell.counter, dxfmock.counter)
def test_dxf_creation_span(self): self.reset_counter() table = Table((0, 0), 3, 3) indices = [(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2), (2, 0), (2, 1), (2, 2)] cell = UserCell(table, 'default', (1, 1)) for row, col in indices: table.set_cell(row, col, cell) spancell = UserCell(table, 'default', span=(2, 2)) # hides 3 cells table.set_cell(0, 0, spancell) table.__dxf__() dxfmock = DXFMock() self.assertEqual(cell.counter, 6) # count get_dxf_entity calls self.assertEqual(cell.counter, dxfmock.counter)
def test_dxf_creation_span(self): self.reset_counter() table = Table((0, 0), 3, 3) indices = [(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2), (2, 0), (2, 1), (2, 2)] cell = TestCell(table, 'default', (1, 1)) for row, col in indices: table.set_cell(row, col, cell) spancell = TestCell(table, 'default', span=(2, 2)) # hides 3 cells table.set_cell(0, 0, spancell) table.__dxf__() dxfmock = DXFMock() self.assertEqual(cell.counter, 6) # count get_dxf_entity calls self.assertEqual(cell.counter, dxfmock.counter)