Esempio n. 1
0
 def test_multiple_nodes_all_empty(self):
     self.assertEqual(
         list(verify.stats_summary({
             'node1': {'good': 0, 'bad': 0},
             'node2': {'good': 0, 'bad': 0},
         })),
         [
             "node health:",
             "    0.0%  node2  (0/0 OK)",
             "    0.0%  node1  (0/0 OK)",
             "overall:  0.0%  (0/0 OK)",
         ],
     )
Esempio n. 2
0
 def test_multiple_nodes(self):
     self.assertEqual(
         list(verify.stats_summary({
             'node1': {'good': 5, 'bad': 3},
             'node2': {'good': 0, 'bad': 0},
             'node3': {'good': 0, 'bad': 3},
             'node4': {'good': 5, 'bad': 0},
         })),
         [
             "node health:",
             "  100.0%  node4  (5/5 OK)",
             "   62.5%  node1  (5/8 OK)",
             "    0.0%  node3  (0/3 OK)",
             "    0.0%  node2  (0/0 OK)",
             "overall:  62.5%  (10/16 OK)",
         ],
     )
Esempio n. 3
0
 def test_single_node(self):
     self.assertEqual(
         list(verify.stats_summary({'node1': {'good': 5, 'bad': 3}})),
         ["node health:  62.5%  (5/8 OK)"],
     )