Example #1
0
 def test_glob(self):
     a_1, a_2, b_1 = MockHost("a-1"), MockHost("a-2"), MockHost("b-1")
     aliases = resolve_alias([a_1, a_2, b_1], ["a-*"])
     self.assertEqual(aliases, [a_1, a_2])
Example #2
0
 def test_resolve_direct_names(self):
     b = MockHost("b")
     hosts = resolve_alias([b], ["b"])
     self.assertEqual(hosts, [b])
Example #3
0
 def test_unsatisfied_glob(self):
     with self.assertRaises(UnresolvableAliasError):
         resolve_alias([], ["a"])
Example #4
0
 def test_resolve_nothing(self):
     aliases = resolve_alias([], [])
     self.assertEqual(aliases, [])
Example #5
0
 def test_glob(self):
     a_1, a_2, b_1 = MockHost("a-1"), MockHost("a-2"), MockHost("b-1")
     aliases = resolve_alias([a_1, a_2, b_1], ["a-*"])
     self.assertEqual(aliases, [a_1, a_2])
Example #6
0
 def test_unsatisfied_glob(self):
     with self.assertRaises(UnresolvableAliasError):
         resolve_alias([], ["a"])
Example #7
0
 def test_resolve_direct_names(self):
     b = MockHost("b")
     hosts = resolve_alias([b], ["b"])
     self.assertEqual(hosts, [b])
Example #8
0
 def test_resolve_nothing(self):
     aliases = resolve_alias([], [])
     self.assertEqual(aliases, [])