Exemple #1
0
 def test_reregister_node(self):
     r = PsDashRunner()
     now = int(time.time())
     r.register_node('examplehost', 'example.org', 5000)
     node = r.register_node('examplehost', 'example.org', 5000)
     self.assertEqual(node.host, 'example.org')
     self.assertEqual(node.port, 5000)
     self.assertEqual(node.last_registered, now)
Exemple #2
0
 def test_get_all_nodes(self):
     r = PsDashRunner()
     r.register_node('examplehost', 'example.org', 5000)
     self.assertEqual(len(r.get_nodes()), 2)  # local + registered