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


Python Dependency.get_ec2_instance_public_dns方法代码示例

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


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

示例1: TestCustomAnalyticsRunner

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

#.........这里部分代码省略.........
        # 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):

        # begin recording
        self.mock_deployment_provider.rsync_to_server(Regex("/python"), "chicken:/signal", Regex("infrastructure/keys/SignalDataKey-USEast-2013-07.pem"))
开发者ID:erezrubinstein,项目名称:aa,代码行数:70,代码来源:test_custom_analytics_runner.py


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