Python oslotest.base 模块,BaseTestCase() 实例源码

我们从Python开源项目中,提取了以下5个代码示例,用于说明如何使用oslotest.base.BaseTestCase()

项目:zun    作者:openstack    | 项目源码 | 文件源码
def setUp(self):
        super(BaseTestCase, self).setUp()
        self.addCleanup(CONF.reset)
项目:kolla-kubernetes    作者:openstack    | 项目源码 | 文件源码
def setUp(self):
        super(BaseTestCase, self).setUp()
        self.addCleanup(cfg.CONF.reset)
        mod_dir = os.path.dirname(sys.modules[__name__].__file__)
        self.project_dir = os.path.abspath(os.path.join(mod_dir, '..', '..'))
项目:monasca-events-api    作者:openstack    | 项目源码 | 文件源码
def setUp(self):
        super(BaseTestCase, self).setUp()
        self.useFixture(fixtures.NestedTempfile())
        self.useFixture(fixtures.TempHomeDir())
        self.useFixture(log_fixture.get_logging_handle_error_fixture())
        self.useFixture(ConfigFixture(CONF))
        self.useFixture(oc_fixture.ClearRequestContext())
        self.useFixture(PolicyFixture())
项目:monasca-events-api    作者:openstack    | 项目源码 | 文件源码
def _prepare_policy(self):
        policy_dir = self.useFixture(fixtures.TempDir())
        policy_file = os.path.join(policy_dir.path, 'policy.yaml')

        # load the fake_policy data and add the missing default rules.
        policy_rules = jsonutils.loads('{}')
        self.add_missing_default_rules(policy_rules)
        with open(policy_file, 'w') as f:
            jsonutils.dump(policy_rules, f)

        BaseTestCase.conf_override(policy_file=policy_file,
                                   group='oslo_policy')
        BaseTestCase.conf_override(policy_dirs=[], group='oslo_policy')
项目:mogan    作者:openstack    | 项目源码 | 文件源码
def setUp(self):
        super(BaseTestCase, self).setUp()
        self.addCleanup(CONF.reset)