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

Method test_join_table

test/test_classes/test_reference.py:23–39  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

21 self.assertIs(ref.table1, t)
22
23 def test_join_table(self) -> None:
24 t1 = Table('books')
25 c11 = Column('id', 'integer', pk=True)
26 c12 = Column('author', 'varchar')
27 t1.add_column(c11)
28 t1.add_column(c12)
29 t2 = Table('authors')
30 c21 = Column('id', 'integer', pk=True)
31 c22 = Column('name', 'varchar')
32 t2.add_column(c21)
33 t2.add_column(c22)
34 ref0 = Reference('>', [c11], [c21])
35 ref = Reference('<>', [c11, c12], [c21, c22])
36
37 self.assertIsNone(ref0.join_table)
38 self.assertEqual(ref.join_table.name, 'books_authors')
39 self.assertEqual(len(ref.join_table.columns), 4)
40
41 def test_join_table_none(self) -> None:
42 t1 = Table('books')

Callers

nothing calls this directly

Calls 4

add_columnMethod · 0.95
TableClass · 0.90
ColumnClass · 0.90
ReferenceClass · 0.90

Tested by

no test coverage detected