コード例 #1
0
 def test_basic(self):
     sot = qos_minimum_bandwidth_rule.QoSMinimumBandwidthRule()
     self.assertEqual('minimum_bandwidth_rule', sot.resource_key)
     self.assertEqual('minimum_bandwidth_rules', sot.resources_key)
     self.assertEqual(
         '/qos/policies/%(qos_policy_id)s/minimum_bandwidth_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_minimum_bandwidth_rule.QoSMinimumBandwidthRule()
     self.assertEqual('minimum_bandwidth_rule', sot.resource_key)
     self.assertEqual('minimum_bandwidth_rules', sot.resources_key)
     self.assertEqual(
         '/qos/policies/%(qos_policy_id)s/minimum_bandwidth_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)
 def test_make_it(self):
     sot = qos_minimum_bandwidth_rule.QoSMinimumBandwidthRule(EXAMPLE)
     self.assertEqual(EXAMPLE['id'], sot.id)
     self.assertEqual(EXAMPLE['qos_policy_id'], sot.qos_policy_id)
     self.assertEqual(EXAMPLE['min_kbps'], sot.min_kbps)
     self.assertEqual(EXAMPLE['direction'], sot.direction)
コード例 #4
0
 def _compare_rules(self, exp, real):
     self.assertDictEqual(
         qos_minimum_bandwidth_rule.QoSMinimumBandwidthRule(
             **exp).to_dict(computed=False),
         real.to_dict(computed=False))