本文整理匯總了Python中common.utilities.inversion_of_control.Dependency.get_stopped_cloud_formation_ec2_instance_ids方法的典型用法代碼示例。如果您正苦於以下問題:Python Dependency.get_stopped_cloud_formation_ec2_instance_ids方法的具體用法?Python Dependency.get_stopped_cloud_formation_ec2_instance_ids怎麽用?Python Dependency.get_stopped_cloud_formation_ec2_instance_ids使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類common.utilities.inversion_of_control.Dependency
的用法示例。
在下文中一共展示了Dependency.get_stopped_cloud_formation_ec2_instance_ids方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: TestCustomAnalyticsRunner
# 需要導入模塊: from common.utilities.inversion_of_control import Dependency [as 別名]
# 或者: from common.utilities.inversion_of_control.Dependency import get_stopped_cloud_formation_ec2_instance_ids [as 別名]
#.........這裏部分代碼省略.........
mock_db_builder.run()
# replay all
self.mox.ReplayAll()
# go
results = CustomAnalyticsRunner(self.task_rec)._create_new_sql_db(mock_ca_run)
self.assertEqual(results, (mock_target_db_name, mock_target_db_logging))
def test_run_loader(self):
# create mocks
mock_db_name = "chilly_willy"
mock_ca_run = { "companies": "chicken_woot" }
# begin stubbing
self.mox.StubOutClassWithMocks(custom_analytics_loader, "CustomAnalyticsLoader")
# begin recording
mock_loader = custom_analytics_loader.CustomAnalyticsLoader(mock_db_name, "chicken_woot")
mock_loader.load().AndReturn("woot")
# replay all
self.mox.ReplayAll()
# go!
self.assertEqual(CustomAnalyticsRunner(self.task_rec)._run_loader(mock_db_name, mock_ca_run), "woot")
def test_create_worker_server__has_stopped_server(self):
# begin recording
self.mock_cloud_provider.get_stopped_cloud_formation_ec2_instance_ids("GeoProcessingWorker").AndReturn(["chicken"])
self.mock_cloud_provider.start_ec2_instance("chicken")
self.mock_cloud_provider.get_ec2_instance_public_dns("chicken").AndReturn("woot")
# replay all
self.mox.ReplayAll()
# go
self.assertEqual(CustomAnalyticsRunner(self.task_rec)._create_worker_server(), "[email protected]")
def test_create_worker_server__create_new_server(self):
# begin recording
self.mock_cloud_provider.get_stopped_cloud_formation_ec2_instance_ids("GeoProcessingWorker").AndReturn([])
self.mock_deployment_provider.create_cloud_server(Regex("/geoprocessing"),
"build/amazon_cloud_formation/create_geo_processing_amazon_worker_server.py",
Regex("create_amazon_ubuntu_geo_processing_server.json"),
"PublicDNS", "GeoProcessingWorker").AndReturn("woot")
# replay all
self.mox.ReplayAll()
# go
self.assertEqual(CustomAnalyticsRunner(self.task_rec)._create_worker_server(), "[email protected]")
def test_create_worker_server(self):
pass
def test_deploy_code_to_worker(self):