当前位置: 首页>>代码示例>>Python>>正文


Python StackInABox.reset_services方法代码示例

本文整理汇总了Python中stackinabox.stack.StackInABox.reset_services方法的典型用法代码示例。如果您正苦于以下问题:Python StackInABox.reset_services方法的具体用法?Python StackInABox.reset_services怎么用?Python StackInABox.reset_services使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在stackinabox.stack.StackInABox的用法示例。


在下文中一共展示了StackInABox.reset_services方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: run

# 需要导入模块: from stackinabox.stack import StackInABox [as 别名]
# 或者: from stackinabox.stack.StackInABox import reset_services [as 别名]
    def run():
        StackInABox.reset_services()
        StackInABox.register_service(HelloService())
        stackinabox.util.responses.registration('localhost')

        res = requests.get('http://localhost/hello/')
        assert res.status_code == 200
        assert res.text == 'Hello'
开发者ID:BenjamenMeyer,项目名称:stackInABox,代码行数:10,代码来源:test_core.py

示例2: run

# 需要导入模块: from stackinabox.stack import StackInABox [as 别名]
# 或者: from stackinabox.stack.StackInABox import reset_services [as 别名]
            def run():
                responses.mock.start()

                StackInABox.reset_services()
                for service in self.services.values():
                    StackInABox.register_service(service)
                responses_registration(self.uri)
                return_value = fn(*args_finalized, **kwargs)
                StackInABox.reset_services()

                responses.mock.stop()
                responses.mock.reset()
开发者ID:BenjamenMeyer,项目名称:stackInABox,代码行数:14,代码来源:decorator.py

示例3: wrapped

# 需要导入模块: from stackinabox.stack import StackInABox [as 别名]
# 或者: from stackinabox.stack.StackInABox import reset_services [as 别名]
        def wrapped(*args, **kwargs):
            args_copy = list(args)
            for arg in self.args:
                args_copy.append(arg)
            args_finalized = tuple(args_copy)
            kwargs.update(self.kwargs)

            if self.enable_service_access is not None:
                kwargs[self.enable_service_access] = self.services

            with requests_mock_activate():
                if self.session is not None:
                    kwargs[self.session] = requests.Session()

                    StackInABox.reset_services()
                    for service in self.services.values():
                        StackInABox.register_service(service)
                    requests_mock_session_registration(
                        self.uri,
                        kwargs[self.session]
                    )
                    return_value = fn(*args_finalized, **kwargs)
                    StackInABox.reset_services()

                else:
                    StackInABox.reset_services()
                    for service in self.services.values():
                        StackInABox.register_service(service)
                    requests_mock_registration(self.uri)
                    return_value = fn(*args_finalized, **kwargs)
                    StackInABox.reset_services()

            return return_value
开发者ID:BenjamenMeyer,项目名称:stackInABox,代码行数:35,代码来源:decorator.py

示例4: tearDown

# 需要导入模块: from stackinabox.stack import StackInABox [as 别名]
# 或者: from stackinabox.stack.StackInABox import reset_services [as 别名]
 def tearDown(self):
     super(TestKeystoneV2UserListing, self).tearDown()
     StackInABox.reset_services()
开发者ID:ananthanithya,项目名称:openstackinabox,代码行数:5,代码来源:test_keystone_v2_user_listing.py

示例5: tearDown

# 需要导入模块: from stackinabox.stack import StackInABox [as 别名]
# 或者: from stackinabox.stack.StackInABox import reset_services [as 别名]
 def tearDown(self):
     super(TestKeystoneV2UserAddCredentials, self).tearDown()
     StackInABox.reset_services()
开发者ID:BenjamenMeyer,项目名称:openstackinabox,代码行数:5,代码来源:test_add_credentials.py

示例6: tearDown

# 需要导入模块: from stackinabox.stack import StackInABox [as 别名]
# 或者: from stackinabox.stack.StackInABox import reset_services [as 别名]
 def tearDown(self):
     super(TestKeystoneV2AuthBase, self).tearDown()
     StackInABox.reset_services()
开发者ID:BenjamenMeyer,项目名称:openstackinabox,代码行数:5,代码来源:base.py

示例7: tearDown

# 需要导入模块: from stackinabox.stack import StackInABox [as 别名]
# 或者: from stackinabox.stack.StackInABox import reset_services [as 别名]
 def tearDown(self):
     super(TestHttprettyKeystone, self).tearDown()
     StackInABox.reset_services()
     self.session.close()
开发者ID:BenjamenMeyer,项目名称:openstackinabox,代码行数:6,代码来源:test_keystone.py

示例8: tearDown

# 需要导入模块: from stackinabox.stack import StackInABox [as 别名]
# 或者: from stackinabox.stack.StackInABox import reset_services [as 别名]
 def tearDown(self):
     super(TestMetrics, self).tearDown()
     StackInABox.reset_services()
开发者ID:andrew-vant,项目名称:eom,代码行数:5,代码来源:test_metrics.py

示例9: tearDown

# 需要导入模块: from stackinabox.stack import StackInABox [as 别名]
# 或者: from stackinabox.stack.StackInABox import reset_services [as 别名]
 def tearDown(self):
     super(TestRequestMockAdvanced, self).tearDown()
     StackInABox.reset_services()
     self.session.close()
开发者ID:kidster,项目名称:stackInABox,代码行数:6,代码来源:test_requests_mock.py

示例10: tearDown

# 需要导入模块: from stackinabox.stack import StackInABox [as 别名]
# 或者: from stackinabox.stack.StackInABox import reset_services [as 别名]
 def tearDown(self):
     super(TestServiceRouteRegistration, self).tearDown()
     StackInABox.reset_services()
开发者ID:kidster,项目名称:stackInABox,代码行数:5,代码来源:test_service.py

示例11: tearDown

# 需要导入模块: from stackinabox.stack import StackInABox [as 别名]
# 或者: from stackinabox.stack.StackInABox import reset_services [as 别名]
 def tearDown(self):
     super(TestKeystoneV2Tenants, self).tearDown()
     StackInABox.reset_services()
开发者ID:ananthanithya,项目名称:openstackinabox,代码行数:5,代码来源:test_keystone_v2_tenants.py

示例12: tearDown

# 需要导入模块: from stackinabox.stack import StackInABox [as 别名]
# 或者: from stackinabox.stack.StackInABox import reset_services [as 别名]
 def tearDown(self):
     super(TestHttprettyAdvanced, self).tearDown()
     StackInABox.reset_services()
开发者ID:BenjamenMeyer,项目名称:stackInABox,代码行数:5,代码来源:test_core.py

示例13: tearDown

# 需要导入模块: from stackinabox.stack import StackInABox [as 别名]
# 或者: from stackinabox.stack.StackInABox import reset_services [as 别名]
 def tearDown(self):
     """
     Test Teardown
     """
     StackInABox.reset_services()
开发者ID:TestInABox,项目名称:stackInAWSGI,代码行数:7,代码来源:test_wsgi_app.py


注:本文中的stackinabox.stack.StackInABox.reset_services方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。