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

Method test_get_refs

test/test_classes/test_column.py:98–114  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

96 self.assertIs(c1.database, s)
97
98 def test_get_refs(self) -> None:
99 c1 = Column(name='client_id', type='integer')
100 with self.assertRaises(TableNotFoundError):
101 c1.get_refs()
102 t1 = Table(name='products')
103 t1.add_column(c1)
104 c2 = Column(name='id', type='integer', autoinc=True, pk=True)
105 t2 = Table(name='clients')
106 t2.add_column(c2)
107
108 ref = Reference(type='>', col1=c1, col2=c2, inline=True)
109 s = Database()
110 s.add(t1)
111 s.add(t2)
112 s.add(ref)
113
114 self.assertEqual(c1.get_refs(), [ref])
115
116 def test_note_property(self):
117 note1 = Note('column note')

Callers

nothing calls this directly

Calls 7

get_refsMethod · 0.95
add_columnMethod · 0.95
addMethod · 0.95
ColumnClass · 0.90
TableClass · 0.90
ReferenceClass · 0.90
DatabaseClass · 0.90

Tested by

no test coverage detected