Beispiel #1
0
 def test_table_index(self):
     schema = Schema(db)
     table = schema.get_table('t1')
     assert ['t1_pkey'] == table.get_indexes()
Beispiel #2
0
 def test_has_enum_type(self):
     schema = Schema(db)
     assert schema.has_enum_type('abc')
Beispiel #3
0
 def test_get_views(self):
     schema = Schema(db)
     assert ['t1_view', 't2_view'
             ] == sorted([t.table_name for t in schema.get_views()])
Beispiel #4
0
 def test_get_enum_type(self):
     schema = Schema(db)
     assert 'abc' == schema.get_enum_type('abc').name
Beispiel #5
0
 def test_get_enum_types(self):
     schema = Schema(db)
     assert ['abc'] == [enum.name for enum in schema.get_enum_types()]
Beispiel #6
0
 def test_has_table(self):
     schema = Schema(db)
     assert schema.has_table(table_name='t1')
Beispiel #7
0
 def test_get_table(self):
     """Make sure that t1 is present in db.
     """
     schema = Schema(db)
     table = schema.get_table(table_name='t1')
     assert table.table_name == 't1'
Beispiel #8
0
 def test_get_tables(self):
     """Make sure that both t1 and t2 are present in db.
     """
     schema = Schema(db)
     tables = schema.get_tables(table_type='BASE TABLE')
     assert ['t1', 't2'] == sorted([t.table_name for t in tables])