Beispiel #1
0
        # server_properties
        record['name'] = "'scalarizr.key'"
        record[
            'value'] = "'8mYTcBxiE70DtXCBRjn7AMuTQNzBJJcTa5uFok24X40ePafq1gUyyg=='"
    fill_server_properties(step)


@step(u"^White Rabbit checks all messages has status (\d+)$")
def check_messages_status(step, status):
    db = dbmanager.DB(lib.world.config['connections']['mysql'])
    query = "SELECT count(messageid) AS count FROM messages WHERE status != {0}".format(
        int(status))
    result = db.execute(query)[0]
    assert result['count'] == 0


def before_scenario(scenario):
    pass


def after_scenario(scenario):
    if hasattr(lib.world, 'wsgi_servers'):
        for wsgi_server in lib.world.wsgi_servers.values():
            wsgi_server.stop()
    if hasattr(lib.world, 'script') and lib.world.script:
        lib.world.script.stop()


before.each_scenario(before_scenario)
after.each_scenario(after_scenario)
Beispiel #2
0
def stop_vpc_router(step):
    lib.world.vpc_router.stop()


@step(u"White Rabbit checks server with server_id '(.*)' was updated$")
def check_update1(step, server_id):
    assert server_id in lib.update_ok
    assert lib.update_ok[server_id]


@step(u"White Rabbit checks server with server_id '(.*)' was updated (\d+) times$")
def check_update2(step, server_id, count):
    if int(count):
        assert server_id in lib.update_count
        assert lib.update_count[server_id] == int(count)


def before_scenario(scenario):
    lib.update_ok = {}
    lib.update_count = {}


def after_scenario(scenario):
    if hasattr(lib.world, 'szr_upd_client'):
        for szr_upd_client in lib.world.szr_upd_client.values():
            szr_upd_client.stop()


before.each_scenario(before_scenario)
after.each_scenario(after_scenario)