MCPcopy Create free account
hub / github.com/Vanderhoof/PyDBML / test_get

Method test_get

test/test_classes/test_table.py:65–78  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

63 self.assertIs(t.indexes[0].table, t)
64
65 def test_get(self) -> None:
66 t = Table('products')
67 c1 = Column('col1', 'integer')
68 c2 = Column('col2', 'integer')
69 c3 = Column('col3', 'integer')
70 t.add_column(c1)
71 t.add_column(c2)
72 self.assertIs(t.get(0), c1)
73 self.assertIs(t.get('col2'), c2)
74 self.assertIsNone(t.get('wrong'))
75 self.assertIsNone(t.get(22))
76 self.assertIs(t.get('wrong', c2), c2)
77 self.assertIs(t.get(22, c2), c2)
78 self.assertIs(t.get('wrong', c3), c3)
79
80 def test_iter(self) -> None:
81 t = Table('products')

Callers

nothing calls this directly

Calls 4

add_columnMethod · 0.95
getMethod · 0.95
TableClass · 0.90
ColumnClass · 0.90

Tested by

no test coverage detected