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

Method test_column_settings

test/test_docs.py:66–85  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

64 self.assertEqual(table['status'].note.text, 'status')
65
66 def test_column_settings(self) -> None:
67 results = PyDBML.parse_file(TEST_DOCS_PATH / 'column_settings.dbml')
68 self.assertEqual(len(results.tables), 1)
69 self.assertEqual(results.tables[0].name, 'buildings')
70
71 table = results.tables[0]
72 self.assertEqual([c.name for c in table.columns], ['address', 'id', 'nullable', 'counter'])
73 address, id_, nullable, counter = table.columns
74 self.assertTrue(address.unique)
75 self.assertTrue(address.not_null)
76 self.assertEqual(address.note.text, 'to include unit number')
77
78 self.assertTrue(id_.pk)
79 self.assertTrue(id_.unique)
80 self.assertEqual(id_.note.text, 'Number')
81 self.assertEqual(id_.default, 123)
82
83 self.assertFalse(nullable.not_null)
84
85 self.assertTrue(counter.autoinc)
86
87 def test_default_value(self) -> None:
88 results = PyDBML.parse_file(TEST_DOCS_PATH / 'default_value.dbml')

Callers

nothing calls this directly

Calls 1

parse_fileMethod · 0.80

Tested by

no test coverage detected