Пример #1
0
 def test_basic(self):
     test_hm = health_monitor.HealthMonitor()
     self.assertEqual('healthmonitor', test_hm.resource_key)
     self.assertEqual('healthmonitors', test_hm.resources_key)
     self.assertEqual('/lbaas/healthmonitors', test_hm.base_path)
     self.assertTrue(test_hm.allow_create)
     self.assertTrue(test_hm.allow_fetch)
     self.assertTrue(test_hm.allow_commit)
     self.assertTrue(test_hm.allow_delete)
     self.assertTrue(test_hm.allow_list)
Пример #2
0
 def test_basic(self):
     test_hm = health_monitor.HealthMonitor()
     self.assertEqual('healthmonitor', test_hm.resource_key)
     self.assertEqual('healthmonitors', test_hm.resources_key)
     self.assertEqual('/v2.0/lbaas/healthmonitors', test_hm.base_path)
     self.assertEqual('load-balancer', test_hm.service.service_type)
     self.assertTrue(test_hm.allow_create)
     self.assertTrue(test_hm.allow_get)
     self.assertTrue(test_hm.allow_update)
     self.assertTrue(test_hm.allow_delete)
     self.assertTrue(test_hm.allow_list)
Пример #3
0
    def test_make_it(self):
        test_hm = health_monitor.HealthMonitor(**EXAMPLE)
        self.assertTrue(test_hm.is_admin_state_up)
        self.assertEqual(EXAMPLE['created_at'], test_hm.created_at)
        self.assertEqual(EXAMPLE['delay'], test_hm.delay)
        self.assertEqual(EXAMPLE['expected_codes'], test_hm.expected_codes)
        self.assertEqual(EXAMPLE['http_method'], test_hm.http_method)
        self.assertEqual(EXAMPLE['id'], test_hm.id)
        self.assertEqual(EXAMPLE['max_retries'], test_hm.max_retries)
        self.assertEqual(EXAMPLE['max_retries_down'], test_hm.max_retries_down)
        self.assertEqual(EXAMPLE['name'], test_hm.name)
        self.assertEqual(EXAMPLE['operating_status'], test_hm.operating_status)
        self.assertEqual(EXAMPLE['pools'], test_hm.pools)
        self.assertEqual(EXAMPLE['pool_id'], test_hm.pool_id)
        self.assertEqual(EXAMPLE['project_id'], test_hm.project_id)
        self.assertEqual(EXAMPLE['provisioning_status'],
                         test_hm.provisioning_status)
        self.assertEqual(EXAMPLE['timeout'], test_hm.timeout)
        self.assertEqual(EXAMPLE['type'], test_hm.type)
        self.assertEqual(EXAMPLE['updated_at'], test_hm.updated_at)
        self.assertEqual(EXAMPLE['url_path'], test_hm.url_path)

        self.assertDictEqual(
            {'limit': 'limit',
             'marker': 'marker',
             'created_at': 'created_at',
             'updated_at': 'updated_at',
             'name': 'name',
             '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',

             'delay': 'delay',
             'expected_codes': 'expected_codes',
             'http_method': 'http_method',
             'max_retries': 'max_retries',
             'max_retries_down': 'max_retries_down',
             'pool_id': 'pool_id',
             'timeout': 'timeout',
             'type': 'type',
             'url_path': 'url_path'
             },
            test_hm._query_mapping._mapping)
 def test_make_it(self):
     test_hm = health_monitor.HealthMonitor(**EXAMPLE)
     self.assertTrue(test_hm.is_admin_state_up)
     self.assertEqual(EXAMPLE['created_at'], test_hm.created_at)
     self.assertEqual(EXAMPLE['delay'], test_hm.delay)
     self.assertEqual(EXAMPLE['expected_codes'], test_hm.expected_codes)
     self.assertEqual(EXAMPLE['http_method'], test_hm.http_method)
     self.assertEqual(EXAMPLE['id'], test_hm.id)
     self.assertEqual(EXAMPLE['max_retries'], test_hm.max_retries)
     self.assertEqual(EXAMPLE['max_retries_down'], test_hm.max_retries_down)
     self.assertEqual(EXAMPLE['name'], test_hm.name)
     self.assertEqual(EXAMPLE['operating_status'], test_hm.operating_status)
     self.assertEqual(EXAMPLE['pool_id'], test_hm.pool_id)
     self.assertEqual(EXAMPLE['project_id'], test_hm.project_id)
     self.assertEqual(EXAMPLE['provisioning_status'],
                      test_hm.provisioning_status)
     self.assertEqual(EXAMPLE['timeout'], test_hm.timeout)
     self.assertEqual(EXAMPLE['type'], test_hm.type)
     self.assertEqual(EXAMPLE['updated_at'], test_hm.updated_at)
     self.assertEqual(EXAMPLE['url_path'], test_hm.url_path)