def test_endpoint_get(self): """ Test if it return a specific endpoint (keystone endpoint-get) """ self.assertDictEqual( keystone.endpoint_get("nova", "RegionOne", profile="openstack"), {"Error": "Could not find the specified service"}, ) ret = {"Error": "Could not find endpoint for the specified service"} MockServices.flag = 1 self.assertDictEqual( keystone.endpoint_get("iptables", "RegionOne", profile="openstack"), ret) MockServices.flag = 0 self.assertDictEqual( keystone.endpoint_get("iptables", "RegionOne", profile="openstack"), { "adminurl": "adminurl", "id": "007", "internalurl": "internalurl", "publicurl": "publicurl", "region": "RegionOne", "service_id": "117", }, )
def test_endpoint_get(self): ''' Test if it return a specific endpoint (keystone endpoint-get) ''' self.assertDictEqual( keystone.endpoint_get('nova', 'RegionOne', profile='openstack'), {'Error': 'Could not find the specified service'}) ret = {'Error': 'Could not find endpoint for the specified service'} MockServices.flag = 1 self.assertDictEqual( keystone.endpoint_get('iptables', 'RegionOne', profile='openstack'), ret) MockServices.flag = 0 self.assertDictEqual( keystone.endpoint_get('iptables', 'RegionOne', profile='openstack'), { 'adminurl': 'adminurl', 'id': '007', 'internalurl': 'internalurl', 'publicurl': 'publicurl', 'region': 'RegionOne', 'service_id': '117' })
def test_endpoint_get(self, mock): ''' Test if it return a specific endpoint (keystone endpoint-get) ''' self.assertDictEqual(keystone.endpoint_get('nova', profile='openstack'), {'Error': 'Could not find the specified service'}) ret = {'Error': 'Could not find endpoint for the specified service'} MockServices.flag = 1 self.assertDictEqual(keystone.endpoint_get('iptables', profile='openstack'), ret) MockServices.flag = 0 self.assertDictEqual(keystone.endpoint_get('iptables', profile='openstack'), {'adminurl': 'adminurl', 'id': '007', 'internalurl': 'internalurl', 'publicurl': 'publicurl', 'region': 'region', 'service_id': '117'})