示例#1
0
 def test_make_it(self):
     sot = qos_bandwidth_limit_rule.QoSBandwidthLimitRule(**EXAMPLE)
     self.assertEqual(EXAMPLE['id'], sot.id)
     self.assertEqual(EXAMPLE['qos_policy_id'], sot.qos_policy_id)
     self.assertEqual(EXAMPLE['max_kbps'], sot.max_kbps)
     self.assertEqual(EXAMPLE['max_burst_kbps'], sot.max_burst_kbps)
     self.assertEqual(EXAMPLE['direction'], sot.direction)
示例#2
0
 def test_basic(self):
     sot = qos_bandwidth_limit_rule.QoSBandwidthLimitRule()
     self.assertEqual('bandwidth_limit_rule', sot.resource_key)
     self.assertEqual('bandwidth_limit_rules', sot.resources_key)
     self.assertEqual(
         '/qos/policies/%(qos_policy_id)s/bandwidth_limit_rules',
         sot.base_path)
     self.assertTrue(sot.allow_create)
     self.assertTrue(sot.allow_fetch)
     self.assertTrue(sot.allow_commit)
     self.assertTrue(sot.allow_delete)
     self.assertTrue(sot.allow_list)
 def test_basic(self):
     sot = qos_bandwidth_limit_rule.QoSBandwidthLimitRule()
     self.assertEqual('bandwidth_limit_rule', sot.resource_key)
     self.assertEqual('bandwidth_limit_rules', sot.resources_key)
     self.assertEqual(
         '/qos/policies/%(qos_policy_id)s/bandwidth_limit_rules',
         sot.base_path)
     self.assertEqual('network', sot.service.service_type)
     self.assertTrue(sot.allow_create)
     self.assertTrue(sot.allow_retrieve)
     self.assertTrue(sot.allow_update)
     self.assertTrue(sot.allow_delete)
     self.assertTrue(sot.allow_list)
示例#4
0
 def _compare_rules(self, exp, real):
     self.assertDictEqual(
         qos_bandwidth_limit_rule.QoSBandwidthLimitRule(**exp).to_dict(
             computed=False), real.to_dict(computed=False))