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


Python Dependency.run_custom_analytics_remotely方法代码示例

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


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

示例1: TestCustomAnalyticsRunner

# 需要导入模块: from common.utilities.inversion_of_control import Dependency [as 别名]
# 或者: from common.utilities.inversion_of_control.Dependency import run_custom_analytics_remotely [as 别名]

#.........这里部分代码省略.........
                "525272003f0cd228d1092401" : {
                    "is_target" : True,
                    "time_periods" : {
                        "t0" : "2012-01-11T00:00:00",
                        "t1" : "2012-03-28T00:00:00"
                    },
                    "company_name" : "Adidas",
                    "weight" : 1
                }
            },
            "time_periods": [
                {
                    "label": "t0",
                    "date": "1900-01-01 00:00:00"
                },
                {
                    "label": "t1",
                    "date": "1900-02-01 00:00:00"
                }
            ],
            "run_comp_stores_report": False,
            "comp_stores_periods": []
        })

        # create misc mocks
        mock_settings = self.mox.CreateMockAnything()

        # begin stubbing
        self.mox.StubOutWithMock(context_managers, "settings")

        # begin recording
        context_managers.settings(host_string = "chicken", key_filename = Regex("SignalDataKey-USEast-2013-07.pem")).AndReturn(mock_settings)
        mock_settings.__enter__()
        self.mock_deployment_provider.run_custom_analytics_remotely("/signal/python/geoprocessing/build/geoprocessing_custom_analytics_executor.py", "/signal/python/geoprocessing", expected_settings)
        mock_settings.__exit__(IgnoreArg(), IgnoreArg(), IgnoreArg())

        # replay all
        self.mox.ReplayAll()

        # go
        CustomAnalyticsRunner(self.task_rec)._call_executor(mock_ca_run, "chicken", "chilly", "willy", "test_client", "test_email", mock_time_periods, .01)


    def test_call_executor__run_comp_stores(self):

        # create a mock ca_run
        # this is a real run from the db
        mock_ca_run = {
            "_cls" : "CustomAnalyticsRun",
            "_id" : ObjectId("5317855ef3d31b80ddcc958a"),
            "_types" : [
                "CustomAnalyticsRun"
            ],
            "client_id" : "51ed900cf3d31bcca5653366",
            "companies" : {
                "518347ea4af885658cf882aa" : {
                    "is_target" : True,
                    "time_periods" : {
                        "t0" : "2012-01-11T00:00:00",
                        "t1" : "2012-03-28T00:00:00"
                    },
                    "company_name" : "Whole Foods Market",
                    "weight" : 1
                },
                "525272003f0cd228d1092401" : {
                    "is_target" : True,
开发者ID:erezrubinstein,项目名称:aa,代码行数:70,代码来源:test_custom_analytics_runner.py


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