Beispiel #1
0
 def test_configure_args(self):
     ActionBalance.configure_args(self.subparsers)
     sys.argv = ['kafka-assigner', 'balance', '-t', 'even']
     parsed_args = self.parser.parse_args()
     assert parsed_args.action == 'balance'
 def test_configure_args(self):
     ActionBalance.configure_args(self.subparsers)
     sys.argv = ['kafka-assigner', 'balance', '-t', 'rackaware']
     parsed_args = self.parser.parse_args()
     assert parsed_args.action == 'balance'
Beispiel #3
0
 def test_right_rackaware_order_works(self):
     self.args.types = ['even', 'rackaware']
     action = ActionBalance(self.args, self.cluster)
     action.process_cluster()
Beispiel #4
0
 def test_process_cluster(self, mock_process):
     self.args.types = ['count']
     action = ActionBalance(self.args, self.cluster)
     action.process_cluster()
     mock_process.assert_called_once_with()
 def test_process_cluster(self, mock_process):
     self.args.types = ['count']
     action = ActionBalance(self.args, self.cluster)
     action.process_cluster()
     mock_process.assert_called_once_with()
 def test_create_class(self):
     self.args.types = ['count']
     action = ActionBalance(self.args, self.cluster)
     assert isinstance(action, ActionBalance)
 def test_right_rackaware_order_works(self):
     self.args.types = ['even', 'rackaware']
     action = ActionBalance(self.args, self.cluster)
     action.process_cluster()