Beispiel #1
0
 def test_basic(self):
     test_l7rule = l7_rule.L7Rule()
     self.assertEqual('rule', test_l7rule.resource_key)
     self.assertEqual('rules', test_l7rule.resources_key)
     self.assertEqual('/lbaas/l7policies/%(l7policy_id)s/rules',
                      test_l7rule.base_path)
     self.assertTrue(test_l7rule.allow_create)
     self.assertTrue(test_l7rule.allow_fetch)
     self.assertTrue(test_l7rule.allow_commit)
     self.assertTrue(test_l7rule.allow_delete)
     self.assertTrue(test_l7rule.allow_list)
 def test_basic(self):
     test_l7rule = l7_rule.L7Rule()
     self.assertEqual('rule', test_l7rule.resource_key)
     self.assertEqual('rules', test_l7rule.resources_key)
     self.assertEqual('/v2.0/lbaas/l7policies/%(l7_policy_id)s/rules',
                      test_l7rule.base_path)
     self.assertEqual('load-balancer', test_l7rule.service.service_type)
     self.assertTrue(test_l7rule.allow_create)
     self.assertTrue(test_l7rule.allow_get)
     self.assertTrue(test_l7rule.allow_update)
     self.assertTrue(test_l7rule.allow_delete)
     self.assertTrue(test_l7rule.allow_list)
Beispiel #3
0
 def test_make_it(self):
     test_l7rule = l7_rule.L7Rule(**EXAMPLE)
     self.assertTrue(test_l7rule.is_admin_state_up)
     self.assertEqual(EXAMPLE['compare_type'], test_l7rule.compare_type)
     self.assertEqual(EXAMPLE['created_at'], test_l7rule.created_at)
     self.assertEqual(EXAMPLE['id'], test_l7rule.id)
     self.assertEqual(EXAMPLE['invert'], test_l7rule.invert)
     self.assertEqual(EXAMPLE['key'], test_l7rule.key)
     self.assertEqual(EXAMPLE['l7_policy_id'], test_l7rule.l7_policy_id)
     self.assertEqual(EXAMPLE['operating_status'],
                      test_l7rule.operating_status)
     self.assertEqual(EXAMPLE['project_id'], test_l7rule.project_id)
     self.assertEqual(EXAMPLE['provisioning_status'],
                      test_l7rule.provisioning_status)
     self.assertEqual(EXAMPLE['type'], test_l7rule.type)
     self.assertEqual(EXAMPLE['updated_at'], test_l7rule.updated_at)
     self.assertEqual(EXAMPLE['value'], test_l7rule.rule_value)
Beispiel #4
0
    def test_make_it(self):
        test_l7rule = l7_rule.L7Rule(**EXAMPLE)
        self.assertTrue(test_l7rule.is_admin_state_up)
        self.assertEqual(EXAMPLE['compare_type'], test_l7rule.compare_type)
        self.assertEqual(EXAMPLE['created_at'], test_l7rule.created_at)
        self.assertEqual(EXAMPLE['id'], test_l7rule.id)
        self.assertEqual(EXAMPLE['invert'], test_l7rule.invert)
        self.assertEqual(EXAMPLE['key'], test_l7rule.key)
        self.assertEqual(EXAMPLE['l7_policy_id'], test_l7rule.l7_policy_id)
        self.assertEqual(EXAMPLE['operating_status'],
                         test_l7rule.operating_status)
        self.assertEqual(EXAMPLE['project_id'], test_l7rule.project_id)
        self.assertEqual(EXAMPLE['provisioning_status'],
                         test_l7rule.provisioning_status)
        self.assertEqual(EXAMPLE['type'], test_l7rule.type)
        self.assertEqual(EXAMPLE['updated_at'], test_l7rule.updated_at)
        self.assertEqual(EXAMPLE['value'], test_l7rule.rule_value)

        self.assertDictEqual(
            {
                'limit': 'limit',
                'marker': 'marker',
                'created_at': 'created_at',
                'updated_at': 'updated_at',
                'project_id': 'project_id',
                'tags': 'tags',
                'any_tags': 'tags-any',
                'not_tags': 'not-tags',
                'not_any_tags': 'not-tags-any',
                'operating_status': 'operating_status',
                'provisioning_status': 'provisioning_status',
                'is_admin_state_up': 'admin_state_up',
                'compare_type': 'compare_type',
                'invert': 'invert',
                'key': 'key',
                'type': 'type',
                'rule_value': 'rule_value',
                'l7_policy_id': 'l7policy_id'
            }, test_l7rule._query_mapping._mapping)