Example #1
0
    def test_base_to_provider_dict(self):

        test_dict = {'provisioning_status': constants.ACTIVE,
                     'operating_status': constants.ONLINE,
                     'provider': 'octavia',
                     'created_at': 'now',
                     'updated_at': 'then',
                     'enabled': True,
                     'project_id': 1}

        result_dict = utils._base_to_provider_dict(test_dict,
                                                   include_project_id=True)
        self.assertEqual({'admin_state_up': True, 'project_id': 1},
                         result_dict)

        result_dict = utils._base_to_provider_dict(test_dict,
                                                   include_project_id=False)
        self.assertEqual({'admin_state_up': True},
                         result_dict)
Example #2
0
    def test_base_to_provider_dict(self):

        test_dict = {'provisioning_status': constants.ACTIVE,
                     'operating_status': constants.ONLINE,
                     'provider': 'octavia',
                     'created_at': 'now',
                     'updated_at': 'then',
                     'enabled': True,
                     'project_id': 1}

        result_dict = utils._base_to_provider_dict(test_dict,
                                                   include_project_id=True)
        self.assertEqual({'admin_state_up': True, 'project_id': 1},
                         result_dict)

        result_dict = utils._base_to_provider_dict(test_dict,
                                                   include_project_id=False)
        self.assertEqual({'admin_state_up': True},
                         result_dict)