| 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') |