Exemple #1
0
def table_creator(base, connection, model_mapping):
    sa.orm.configure_mappers()
    base.metadata.create_all(connection)
    pg_base = Base(connection.engine.url.database)
    pg_base.create_triggers(
        connection.engine.url.database,
        DEFAULT_SCHEMA,
    )
    pg_base.drop_replication_slot(f"{connection.engine.url.database}_testdb")
    pg_base.create_replication_slot(f"{connection.engine.url.database}_testdb")
    yield
    pg_base.drop_replication_slot(f"{connection.engine.url.database}_testdb")
    base.metadata.drop_all(connection)
    try:
        os.unlink(f".{connection.engine.url.database}_testdb")
    except OSError:
        pass
 def test_create_replication_slot(self, connection):
     pg_base = Base(connection.engine.url.database)
     row = pg_base.create_replication_slot("slot_name")
     assert row[0] == "slot_name"
     assert row[1] is not None
     pg_base.drop_replication_slot("slot_name")
 def test_drop_replication_slot(self, connection):
     pg_base = Base(connection.engine.url.database)
     pg_base.create_replication_slot("slot_name")
     pg_base.drop_replication_slot("slot_name")
Exemple #4
0
 def test_create_replication_slot(self, connection):
     pg_base = Base(connection.engine.url.database)
     row = pg_base.create_replication_slot('slot_name')
     assert row[0] == 'slot_name'
     assert row[1] != None
     pg_base.drop_replication_slot('slot_name')