示例#1
0
 def test_table_index(self):
     schema = Schema(db)
     table = schema.get_table('t1')
     assert ['t1_pkey'] == table.get_indexes()
示例#2
0
 def test_has_enum_type(self):
     schema = Schema(db)
     assert schema.has_enum_type('abc')
示例#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()])
示例#4
0
 def test_get_enum_type(self):
     schema = Schema(db)
     assert 'abc' == schema.get_enum_type('abc').name
示例#5
0
 def test_get_enum_types(self):
     schema = Schema(db)
     assert ['abc'] == [enum.name for enum in schema.get_enum_types()]
示例#6
0
 def test_has_table(self):
     schema = Schema(db)
     assert schema.has_table(table_name='t1')
示例#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'
示例#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])