本文整理汇总了Python中common.utilities.inversion_of_control.Dependency.update_environmental_setting方法的典型用法代码示例。如果您正苦于以下问题:Python Dependency.update_environmental_setting方法的具体用法?Python Dependency.update_environmental_setting怎么用?Python Dependency.update_environmental_setting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common.utilities.inversion_of_control.Dependency
的用法示例。
在下文中一共展示了Dependency.update_environmental_setting方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestCustomAnalyticsExecutor
# 需要导入模块: from common.utilities.inversion_of_control import Dependency [as 别名]
# 或者: from common.utilities.inversion_of_control.Dependency import update_environmental_setting [as 别名]
#.........这里部分代码省略.........
self.mox.StubOutWithMock(executor, "_handle_error")
self.mox.StubOutWithMock(executor, "_update_and_reset_config")
self.mox.StubOutWithMock(executor, "_update_ca_run_status")
self.mox.StubOutWithMock(executor, "_clear_log_file")
self.mox.StubOutWithMock(executor, "_execute_controller")
self.mox.StubOutWithMock(executor, "_run_data_checks")
self.mox.StubOutWithMock(executor, "_run_custom_analytics")
self.mox.StubOutWithMock(executor, "_upload_file_to_rds")
self.mox.StubOutWithMock(executor, "_shrink_db")
self.mox.StubOutWithMock(executor, "_send_success_email")
self.mox.StubOutWithMock(executor, "_shut_down_worker_server")
# begin recording (raise exception on geoprocessing controller)
executor._update_path()
executor._update_and_reset_config().AndReturn(("fuzzy", "wuzzy", "was", "a", "bear", "chicken", "woot", "borat", "sagdiev"))
executor._update_ca_run_status()
executor._clear_log_file()
executor._execute_controller().WithSideEffects(raise_exception)
executor._handle_error("yo mama", IsA(basestring), "fuzzy", "wuzzy", "was", "a", "bear")
# replay all
self.mox.ReplayAll()
# I love gooooooold
executor.execute()
# make sure the ca id set for the heart beat
self.assertEqual(executor._custom_analytics_run_id, "fuzzy")
def test_update_path(self):
# begin recording
self.mock_deployment_provider.update_environmental_setting("PYTHONPATH", "/signal/python/geoprocessing")
# replay all
self.mox.ReplayAll()
# I love gooooooold
CustomAnalyticsExecutor()._update_path()
def test_clear_log_file(self):
# begin recording
self.mock_deployment_provider.clear_log_file("/signal/python/geoprocessing", "log.txt")
# replay all
self.mox.ReplayAll()
# I love gooooooold
CustomAnalyticsExecutor()._clear_log_file()
def test_execute_controller(self):
# begin recording
self.mock_deployment_provider.execute_controller("/signal/python/geoprocessing")
# replay all
self.mox.ReplayAll()
# I love gooooooold
CustomAnalyticsExecutor()._execute_controller()