def test_table_index(self): schema = Schema(db) table = schema.get_table('t1') assert ['t1_pkey'] == table.get_indexes()
def test_has_enum_type(self): schema = Schema(db) assert schema.has_enum_type('abc')
def test_get_views(self): schema = Schema(db) assert ['t1_view', 't2_view' ] == sorted([t.table_name for t in schema.get_views()])
def test_get_enum_type(self): schema = Schema(db) assert 'abc' == schema.get_enum_type('abc').name
def test_get_enum_types(self): schema = Schema(db) assert ['abc'] == [enum.name for enum in schema.get_enum_types()]
def test_has_table(self): schema = Schema(db) assert schema.has_table(table_name='t1')
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'
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])