def setUp(self):
     self.known_name = "node"
     self.unknown_name = "none"
     self.known_host = host.PcsKnownHost(self.known_name, "token",
                                         [host.Destination("addr", "port")])
     self.factory = lib.NodeTargetFactory(
         {self.known_name: self.known_host})
Beispiel #2
0
 def test_success(self):
     known_host = host.PcsKnownHost("name", "token", [
         host.Destination("addr1", "addr2"),
         host.Destination("addr2", "port2"),
     ])
     target = lib.RequestTarget.from_known_host(known_host)
     self.assertEqual(known_host.name, target.label)
     self.assertEqual(known_host.token, target.token)
     self.assertEqual(known_host.dest_list, target.dest_list)
Beispiel #3
0
 def test_dest_list_empty(self):
     self.assertEqual(
         self.default_dest, host.PcsKnownHost(self.name, None, []).dest
     )