def setUp(self):
        super(TestSetNetworkQosRuleBandwidthLimit, self).setUp()
        attrs = {
            'qos_policy_id': self.qos_policy.id,
            'type': RULE_TYPE_BANDWIDTH_LIMIT
        }
        self.new_rule = network_fakes.FakeNetworkQosRule.create_one_qos_rule(
            attrs=attrs)
        self.qos_policy.rules = [self.new_rule]
        self.network.update_qos_bandwidth_limit_rule = mock.Mock(
            return_value=None)
        self.network.find_qos_bandwidth_limit_rule = mock.Mock(
            return_value=self.new_rule)
        self.network.find_qos_policy = mock.Mock(return_value=self.qos_policy)

        # Get the command object to test
        self.cmd = (network_qos_rule.SetNetworkQosRule(self.app,
                                                       self.namespace))
    def setUp(self):
        super(TestSetNetworkQosRuleDSCPMarking, self).setUp()
        attrs = {
            'qos_policy_id': self.qos_policy.id,
            'type': RULE_TYPE_DSCP_MARKING
        }
        self.new_rule = network_fakes.FakeNetworkQosRule.create_one_qos_rule(
            attrs=attrs)
        self.qos_policy.rules = [self.new_rule]
        self.network.update_qos_dscp_marking_rule = mock.Mock(
            return_value=None)
        self.network.find_qos_dscp_marking_rule = mock.Mock(
            return_value=self.new_rule)
        self.network.find_qos_policy = mock.Mock(return_value=self.qos_policy)

        # Get the command object to test
        self.cmd = (network_qos_rule.SetNetworkQosRule(self.app,
                                                       self.namespace))