

def test_create_dscp_marking_rule_with_dscp_mark(self):
    cmd = dscp_rule.CreateQoSDscpMarkingRule(test_cli20.MyApp(sys.stdout), None)
    my_id = 'my-id'
    policy_id = 'policy_id'
    position_names = ['dscp_mark']
    valid_dscp_marks = ['0', '56']
    invalid_dscp_marks = ['-1', '19', '42', '44', '57', '58']
    for dscp_mark in valid_dscp_marks:
        args = ['--dscp-mark', dscp_mark, policy_id]
        position_values = [dscp_mark]
        self._test_create_resource(self.dscp_res, cmd, '', my_id, args, position_names, position_values, cmd_resource=self.dscp_cmd_res, parent_id=policy_id)
    for dscp_mark in invalid_dscp_marks:
        args = ['--dscp-mark', dscp_mark, policy_id]
        position_values = [dscp_mark]
        self._test_create_resource(self.dscp_res, cmd, '', my_id, args, position_names, position_values, cmd_resource=self.dscp_cmd_res, parent_id=policy_id, no_api_call=True, expected_exception=exceptions.CommandError)

dataset/ETHPy150Open openstack/python-neutronclient/neutronclient/tests/unit/qos/test_cli20_dscp_marking_rule.py CLITestV20QoSDscpMarkingRuleJSON.test_create_dscp_marking_rule_with_dscp_mark/original