當前位置: 首頁>>代碼示例>>Python>>正文


Python DependencyResolver.get_stack_order方法代碼示例

本文整理匯總了Python中cfn_sphere.stack_configuration.dependency_resolver.DependencyResolver.get_stack_order方法的典型用法代碼示例。如果您正苦於以下問題:Python DependencyResolver.get_stack_order方法的具體用法?Python DependencyResolver.get_stack_order怎麽用?Python DependencyResolver.get_stack_order使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在cfn_sphere.stack_configuration.dependency_resolver.DependencyResolver的用法示例。


在下文中一共展示了DependencyResolver.get_stack_order方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_get_stack_order_raises_exception_on_cyclic_dependency

# 需要導入模塊: from cfn_sphere.stack_configuration.dependency_resolver import DependencyResolver [as 別名]
# 或者: from cfn_sphere.stack_configuration.dependency_resolver.DependencyResolver import get_stack_order [as 別名]
    def test_get_stack_order_raises_exception_on_cyclic_dependency(self):
        stacks = {
            'app1': StackConfig({'template-url': 'horst.yml', 'parameters': {'a': '|Ref|app2.id'}}),
            'app2': StackConfig({'template-url': 'horst.yml', 'parameters': {'a': '|Ref|app3.id'}}),
            'app3': StackConfig({'template-url': 'horst.yml', 'parameters': {'a': '|Ref|app1.id'}})
        }

        with self.assertRaises(CyclicDependencyException):
            DependencyResolver.get_stack_order(stacks)
開發者ID:philipppahl,項目名稱:cfn-sphere,代碼行數:11,代碼來源:dependency_resolver_tests.py

示例2: test_get_stack_order_raises_exception_on_cyclic_dependency

# 需要導入模塊: from cfn_sphere.stack_configuration.dependency_resolver import DependencyResolver [as 別名]
# 或者: from cfn_sphere.stack_configuration.dependency_resolver.DependencyResolver import get_stack_order [as 別名]
    def test_get_stack_order_raises_exception_on_cyclic_dependency(self):
        stacks = {
            "app1": StackConfig({"template-url": "horst.yml", "parameters": {"a": "|Ref|app2.id"}}),
            "app2": StackConfig({"template-url": "horst.yml", "parameters": {"a": "|Ref|app3.id"}}),
            "app3": StackConfig({"template-url": "horst.yml", "parameters": {"a": "|Ref|app1.id"}}),
        }

        with self.assertRaises(CyclicDependencyException):
            DependencyResolver.get_stack_order(stacks)
開發者ID:oliver-schoenherr,項目名稱:cfn-sphere,代碼行數:11,代碼來源:dependency_resolver_tests.py

示例3: test_get_stack_order_accepts_stacks_without_parameters_key

# 需要導入模塊: from cfn_sphere.stack_configuration.dependency_resolver import DependencyResolver [as 別名]
# 或者: from cfn_sphere.stack_configuration.dependency_resolver.DependencyResolver import get_stack_order [as 別名]
    def test_get_stack_order_accepts_stacks_without_parameters_key(self):
        stacks = {'default-sg': {},
                  'app1': None,
                  'app2': {},
                  'vpc': {},
                  }

        result = 4

        self.assertEqual(result, len(DependencyResolver.get_stack_order(stacks)))
開發者ID:philipppahl,項目名稱:cfn-sphere,代碼行數:12,代碼來源:dependency_resolver_tests.py

示例4: test_get_stack_order_includes_independent_stacks

# 需要導入模塊: from cfn_sphere.stack_configuration.dependency_resolver import DependencyResolver [as 別名]
# 或者: from cfn_sphere.stack_configuration.dependency_resolver.DependencyResolver import get_stack_order [as 別名]
    def test_get_stack_order_includes_independent_stacks(self):
        stacks = {'default-sg': StackConfig({'template-url': 'horst.yml'}),
                  'app1': StackConfig(
                      {'template-url': 'horst.yml', 'parameters': {'a': '|Ref|vpc.id', 'b': '|Ref|default-sg.id'}}),
                  'app2': StackConfig({'template-url': 'horst.yml',
                                       'parameters': {'a': '|Ref|vpc.id', 'b': '|Ref|default-sg.id',
                                                      'c': 'Ref::app1.id'}}),
                  'vpc': StackConfig({'template-url': 'horst.yml',
                                      'parameters': {'logBucketName': 'is24-cloudtrail-logs',
                                                     'includeGlobalServices': False}})
                  }

        result = 4

        self.assertEqual(result, len(DependencyResolver.get_stack_order(stacks)))
開發者ID:philipppahl,項目名稱:cfn-sphere,代碼行數:17,代碼來源:dependency_resolver_tests.py

示例5: test_get_stack_order_returns_a_valid_order_from_ref_in_list

# 需要導入模塊: from cfn_sphere.stack_configuration.dependency_resolver import DependencyResolver [as 別名]
# 或者: from cfn_sphere.stack_configuration.dependency_resolver.DependencyResolver import get_stack_order [as 別名]
    def test_get_stack_order_returns_a_valid_order_from_ref_in_list(self):
        stacks = {'default-sg': StackConfig({'template-url': 'horst.yml', 'parameters': {'a': ['|Ref|vpc.id']}}),
                  'app1': StackConfig(
                      {'template-url': 'horst.yml', 'parameters': {'a': ['|Ref|vpc.id'], 'b': ['|Ref|default-sg.id']}}),
                  'app2': StackConfig({'template-url': 'horst.yml',
                                       'parameters': {'a': ['|Ref|vpc.id'], 'b': ['|Ref|default-sg.id'],
                                                      'c': ['|Ref|app1.id']}}),
                  'vpc': StackConfig({'template-url': 'horst.yml',
                                      'parameters': {'logBucketName': 'is24-cloudtrail-logs',
                                                     'includeGlobalServices': False}})
                  }

        expected = ['vpc', 'default-sg', 'app1', 'app2']

        self.assertEqual(expected, DependencyResolver.get_stack_order(stacks))
開發者ID:philipppahl,項目名稱:cfn-sphere,代碼行數:17,代碼來源:dependency_resolver_tests.py

示例6: test_get_stack_order_includes_independent_stacks

# 需要導入模塊: from cfn_sphere.stack_configuration.dependency_resolver import DependencyResolver [as 別名]
# 或者: from cfn_sphere.stack_configuration.dependency_resolver.DependencyResolver import get_stack_order [as 別名]
    def test_get_stack_order_includes_independent_stacks(self):
        stacks = {
            "default-sg": StackConfig({"template-url": "horst.yml"}),
            "app1": StackConfig(
                {"template-url": "horst.yml", "parameters": {"a": "|Ref|vpc.id", "b": "|Ref|default-sg.id"}}
            ),
            "app2": StackConfig(
                {
                    "template-url": "horst.yml",
                    "parameters": {"a": "|Ref|vpc.id", "b": "|Ref|default-sg.id", "c": "Ref::app1.id"},
                }
            ),
            "vpc": StackConfig(
                {
                    "template-url": "horst.yml",
                    "parameters": {"logBucketName": "is24-cloudtrail-logs", "includeGlobalServices": False},
                }
            ),
        }

        result = 4

        self.assertEqual(result, len(DependencyResolver.get_stack_order(stacks)))
開發者ID:oliver-schoenherr,項目名稱:cfn-sphere,代碼行數:25,代碼來源:dependency_resolver_tests.py

示例7: test_get_stack_order_returns_a_valid_order

# 需要導入模塊: from cfn_sphere.stack_configuration.dependency_resolver import DependencyResolver [as 別名]
# 或者: from cfn_sphere.stack_configuration.dependency_resolver.DependencyResolver import get_stack_order [as 別名]
    def test_get_stack_order_returns_a_valid_order(self):
        stacks = {
            "default-sg": StackConfig({"template-url": "horst.yml", "parameters": {"a": "|Ref|vpc.id"}}),
            "app1": StackConfig(
                {"template-url": "horst.yml", "parameters": {"a": "|Ref|vpc.id", "b": "|Ref|default-sg.id"}}
            ),
            "app2": StackConfig(
                {
                    "template-url": "horst.yml",
                    "parameters": {"a": "|Ref|vpc.id", "b": "|Ref|default-sg.id", "c": "|Ref|app1.id"},
                }
            ),
            "vpc": StackConfig(
                {
                    "template-url": "horst.yml",
                    "parameters": {"logBucketName": "is24-cloudtrail-logs", "includeGlobalServices": False},
                }
            ),
        }

        expected = ["vpc", "default-sg", "app1", "app2"]

        self.assertEqual(expected, DependencyResolver.get_stack_order(stacks))
開發者ID:oliver-schoenherr,項目名稱:cfn-sphere,代碼行數:25,代碼來源:dependency_resolver_tests.py

示例8: test_get_stack_order_accepts_stacks_without_parameters_key

# 需要導入模塊: from cfn_sphere.stack_configuration.dependency_resolver import DependencyResolver [as 別名]
# 或者: from cfn_sphere.stack_configuration.dependency_resolver.DependencyResolver import get_stack_order [as 別名]
    def test_get_stack_order_accepts_stacks_without_parameters_key(self):
        stacks = {"default-sg": {}, "app1": None, "app2": {}, "vpc": {}}

        result = 4

        self.assertEqual(result, len(DependencyResolver.get_stack_order(stacks)))
開發者ID:oliver-schoenherr,項目名稱:cfn-sphere,代碼行數:8,代碼來源:dependency_resolver_tests.py


注:本文中的cfn_sphere.stack_configuration.dependency_resolver.DependencyResolver.get_stack_order方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。