Пример #1
0
 def test_output_single_value_for_leader(self):
     r = CactiHandler().analyze(TestCactiHandler.Opts(leader=True), {
         's1:2181': {'a':1, 'zk_server_state': 'leader'},
         's2:2181': {'a':2}
     })
     self.assertEqual(r, 0)
     self.assertEqual(self.output(), '1\n')
Пример #2
0
 def test_output_values_for_all_hosts(self):
     r = CactiHandler().analyze(TestCactiHandler.Opts(), {
         's1:2181':{'a':1},
         's2:2181':{'a':2, 'b':3}
     })
     self.assertEqual(r, None)
     self.assertEqual(self.output(), 's1_2181:1 s2_2181:2')