MCPcopy Index your code
hub / github.com/Vanderhoof/PyDBML / test_table_refs

Method test_table_refs

test/test_parser.py:19–32  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

17 self.results = PyDBML.parse_file(TEST_DATA_PATH / 'general.dbml')
18
19 def test_table_refs(self) -> None:
20 p = PyDBML.parse_file(TEST_DATA_PATH / 'general.dbml')
21 r = p['public.orders'].get_refs()
22 self.assertEqual(r[0].col2[0].name, 'order_id')
23 self.assertEqual(r[0].col1[0].table.name, 'orders')
24 self.assertEqual(r[0].col1[0].name, 'id')
25 r = p['public.products'].get_refs()
26 self.assertEqual(r[1].col1[0].name, 'merchant_id')
27 self.assertEqual(r[1].col2[0].table.name, 'merchants')
28 self.assertEqual(r[1].col2[0].name, 'id')
29 r = p['public.users'].get_refs()
30 self.assertEqual(r[0].col1[0].name, 'country_code')
31 self.assertEqual(r[0].col2[0].table.name, 'countries')
32 self.assertEqual(r[0].col2[0].name, 'code')
33
34 def test_refs(self) -> None:
35 p = PyDBML.parse_file(TEST_DATA_PATH / 'general.dbml')

Callers

nothing calls this directly

Calls 2

parse_fileMethod · 0.80
get_refsMethod · 0.45

Tested by

no test coverage detected