'Test pure v3 endpoint can be fetched via v2.0 API.
For those who are using v2.0 APIs, endpoints created by v3 API should
also be visible as there are no differences about the endpoints
except the format or the internal implementation. Since publicURL is
required for v2.0 API, so only v3 endpoints of the service which have
the public interface endpoint will be converted into v2.0 endpoints.'

def test_pure_v3_endpoint_with_publicurl_visible_from_v2(self):

    region_id = self._region_create()
    body = {'endpoint': unit.new_endpoint_ref(self.service_id, region_id=region_id)}
    for interface in catalog.controllers.INTERFACES:
        body['endpoint']['interface'] = interface
        self.admin_request(method='POST', token=self.get_scoped_token(), path='/v3/endpoints', expected_status=http_client.CREATED, body=body)
    r = self.admin_request(token=self.get_scoped_token(), path='/v2.0/endpoints')
    self.assertEqual(1, len(r.result['endpoints']))
    v2_endpoint = r.result['endpoints'][0]
    self.assertEqual(self.service_id, v2_endpoint['service_id'])
    self.assertEqual(body['endpoint']['url'], v2_endpoint['publicurl'])
    self.assertEqual(body['endpoint']['url'], v2_endpoint['adminurl'])
    self.assertEqual(body['endpoint']['url'], v2_endpoint['internalurl'])
    self.assertNotIn('name', v2_endpoint)
    v3_endpoint = self.catalog_api.get_endpoint(v2_endpoint['id'])
    self.assertEqual('public', v3_endpoint['interface'])
    self.assertEqual(self.service_id, v3_endpoint['service_id'])
