예제 #1
0
 def test_compare_display(self):
     c = Main().constructor([
         'compare',
         '--rule', 'firstn',
         '--values-count', '1000',
     ])
     c1, c2 = self.define_crushmaps_2()
     c.set_origin(c2)
     c.set_destination(c1)
     c.args.replication_count = 1
     c.compare()
     out = c.display()
     print(out)
     assert "objects%   10.20%   12.70%   22.90%" in out
     c.args.replication_count = 3
     c.compare()
     out = c.display()
     print(out)
     assert ("objects%    0.17%    0.13%    0.97%    0.77%    0.77%"
             "    0.63%    0.73%    0.87%   12.30%   12.20%   29.53%") in out
예제 #2
0
 def test_display(self):
     c1, c2 = self.define_crushmaps_1()
     c = Main().constructor([
         'compare',
         '--rule', 'indep',
         '--replication-count', '2',
         '--values-count', '10',
     ])
     c.set_origin(c1)
     c.set_destination(c2)
     c.compare()
     out = c.display()
     print(out)
     assert 'device04        0        0        1        1   10.00%' in out
     assert 'objects%   10.00%    5.00%    5.00%    5.00%   25.00%' in out