Example #1
0
 def test_create_minimum_bandwidth_rule_all(self):
     cmd = bw_rule.CreateQoSMinimumBandwidthRule(
         test_cli20.MyApp(sys.stdout), None)
     my_id = 'my-id'
     min_kbps = '1500'
     direction = 'egress'
     policy_id = 'policy_id'
     args = ['--min-kbps', min_kbps, '--direction', direction, policy_id]
     position_names = ['direction', 'min_kbps']
     position_values = [direction, min_kbps]
     self._test_create_resource(self.res,
                                cmd,
                                '',
                                my_id,
                                args,
                                position_names,
                                position_values,
                                cmd_resource=self.cmd_res,
                                parent_id=policy_id)
Example #2
0
 def test_create_minimum_bandwidth_rule_none(self):
     cmd = bw_rule.CreateQoSMinimumBandwidthRule(
         test_cli20.MyApp(sys.stdout), None)
     my_id = 'my-id'
     policy_id = 'policy_id'
     args = [policy_id]
     position_names = []
     position_values = []
     self.assertRaises(SystemExit,
                       self._test_create_resource,
                       self.res,
                       cmd,
                       '',
                       my_id,
                       args,
                       position_names,
                       position_values,
                       cmd_resource=self.cmd_res,
                       parent_id=policy_id,
                       no_api_call=True)