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

Method test_geititem

test/test_database.py:270–285  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

268 database.delete_project()
269
270 def test_geititem(self) -> None:
271 t1 = Table('table1')
272 t2 = Table('table2', schema='myschema')
273 database = Database()
274 database.add_table(t1)
275 database.add_table(t2)
276 self.assertIs(database['public.table1'], t1)
277 self.assertIs(database['myschema.table2'], t2)
278 self.assertIs(database[0], t1)
279 self.assertIs(database[1], t2)
280 with self.assertRaises(TypeError):
281 database[None]
282 with self.assertRaises(IndexError):
283 database[2]
284 with self.assertRaises(KeyError):
285 database['wrong']
286
287 def test_iter(self) -> None:
288 t1 = Table('table1')

Callers

nothing calls this directly

Calls 3

add_tableMethod · 0.95
TableClass · 0.90
DatabaseClass · 0.90

Tested by

no test coverage detected