Exemplo n.º 1
0
    def setUp(self):
        """Run before each method to initialize test environment."""
        super(TestCase, self).setUp()

        self.log_fixture = self.useFixture(fixtures.FakeLogger())
        self.useFixture(conf_fixture.ConfFixture(CONF))
        self.messaging_conf = messaging_conffixture.ConfFixture(CONF)
        self.messaging_conf.transport_driver = 'fake'
        self.messaging_conf.response_timeout = 15
        self.useFixture(self.messaging_conf)

        rpc.init(CONF)

        global _DB_CACHE
        if not _DB_CACHE:
            _DB_CACHE = Database(
                session, migration, sql_connection=CONF.database.connection,
                sqlite_db=CONF.sqlite_db, sqlite_clean_db=CONF.sqlite_clean_db
            )
        self.useFixture(_DB_CACHE)
        _redis = Redis()
        self.useFixture(_redis)
Exemplo n.º 2
0
    def setUp(self):
        """Run before each method to initialize test environment."""
        super(TestCase, self).setUp()

        self.log_fixture = self.useFixture(fixtures.FakeLogger())
        self.useFixture(conf_fixture.ConfFixture(CONF))
        self.messaging_conf = messaging_conffixture.ConfFixture(CONF)
        self.messaging_conf.transport_driver = 'fake'
        self.messaging_conf.response_timeout = 15
        self.useFixture(self.messaging_conf)

        rpc.init(CONF)

        global _DB_CACHE
        if not _DB_CACHE:
            _DB_CACHE = Database(session,
                                 migration,
                                 sql_connection=CONF.database.connection,
                                 sqlite_db=CONF.sqlite_db,
                                 sqlite_clean_db=CONF.sqlite_clean_db)
        self.useFixture(_DB_CACHE)
        _redis = Redis()
        self.useFixture(_redis)
Exemplo n.º 3
0
def prepare_args(argv):
    cfg.CONF(argv[1:], project='payload', version=version.VERSION_STRING())
    rpc.init(cfg.CONF)
Exemplo n.º 4
0
def prepare_args(argv):
    cfg.CONF(
        argv[1:], project='payload', version=version.VERSION_STRING())
    rpc.init(cfg.CONF)