コード例 #1
0
ファイル: test_config.py プロジェクト: akramarev/blockade
    def test_link_ordering_circular_1(self):
        containers = [BlockadeContainerConfig("c1", "image"),
                      BlockadeContainerConfig("c2", "image", links=["c1"]),
                      BlockadeContainerConfig("c3", "image", links=["c3"])]

        with self.assertRaisesRegexp(BlockadeConfigError, "circular"):
            dependency_sorted(containers)
コード例 #2
0
ファイル: test_config.py プロジェクト: akramarev/blockade
 def test_link_ordering_unknown_2(self):
     containers = [BlockadeContainerConfig("c1", "image"),
                   BlockadeContainerConfig("c2", "image",
                                           links=["c6", "c7"]),
                   BlockadeContainerConfig("c3", "image", links=["c1"])]
     with self.assertRaisesRegexp(BlockadeConfigError, "unknown"):
         dependency_sorted(containers)
コード例 #3
0
ファイル: test_config.py プロジェクト: evverx/blockade
 def test_link_ordering_unknown_2(self):
     containers = [
         BlockadeContainerConfig("c1", "image"),
         BlockadeContainerConfig("c2", "image", links=["c6", "c7"]),
         BlockadeContainerConfig("c3", "image", links=["c1"])
     ]
     with self.assertRaisesRegexp(BlockadeConfigError, "unknown"):
         dependency_sorted(containers)
コード例 #4
0
ファイル: test_config.py プロジェクト: evverx/blockade
    def test_link_ordering_circular_1(self):
        containers = [
            BlockadeContainerConfig("c1", "image"),
            BlockadeContainerConfig("c2", "image", links=["c1"]),
            BlockadeContainerConfig("c3", "image", links=["c3"])
        ]

        with self.assertRaisesRegexp(BlockadeConfigError, "circular"):
            dependency_sorted(containers)
コード例 #5
0
ファイル: test_config.py プロジェクト: akramarev/blockade
 def test_link_ordering_1(self):
     containers = [BlockadeContainerConfig("c1", "image"),
                   BlockadeContainerConfig("c2", "image"),
                   BlockadeContainerConfig("c3", "image")]
     ordered = dependency_sorted(containers)
     ordered_names = [c.name for c in ordered]
     self.assertDependencyLevels(ordered_names, ["c1", "c2", "c3"])
コード例 #6
0
ファイル: test_config.py プロジェクト: evverx/blockade
 def test_link_ordering_3(self):
     containers = [
         BlockadeContainerConfig("c1", "image"),
         BlockadeContainerConfig("c2", "image", links={"c1": "c1"}),
         BlockadeContainerConfig("c3", "image", links={"c1": "c1"})
     ]
     ordered = dependency_sorted(containers)
     ordered_names = [c.name for c in ordered]
     self.assertDependencyLevels(ordered_names, ["c1"], ["c2", "c3"])