Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • osdu/platform/system/reference/crs-conversion-service
1 result
Show changes
Commits on Source (2)
...@@ -337,17 +337,31 @@ class TestCrsConverterIntegration(unittest.TestCase): ...@@ -337,17 +337,31 @@ class TestCrsConverterIntegration(unittest.TestCase):
self.assertIsNotNone(request) self.assertIsNotNone(request)
#try: #try:
# Convert a GeoJSON or AnyCrsGeoJson structure # Convert a GeoJSON or AnyCrsGeoJson structure
api_response = self.api_instance.convert_geo_json(body=request, data_partition_id=data_partition_header)
self.assertIsNotNone(api_response) print('SIS_DATA environment value'+os.environ['SIS_DATA'])
self.assertEquals(api_response.feature_collection.type, 'FeatureCollection') #try:
# prepare round-trip # Convert a GeoJSON or AnyCrsGeoJson structure
n_request = ConvertGeoJsonRequest(to_crs=LAS, feature_collection=api_response.feature_collection) try:
api_response = self.api_instance.convert_geo_json(body=n_request, data_partition_id=data_partition_header) print('API-Body-Request:\n%s' % request)
self.assertIsNotNone(api_response) print('data_partition_header:\n%s' % data_partition_header)
self.assertEquals(api_response.feature_collection.type, 'AnyCrsFeatureCollection') api_response = self.api_instance.convert_geo_json(body=request, data_partition_id=data_partition_header)
c = CompareResponseWithExpectation(api_response.feature_collection, expected=request.feature_collection) self.assertIsNotNone(api_response)
ok = c.compare_feature_collections() self.assertEquals(api_response.feature_collection.type, 'FeatureCollection')
self.assertTrue(ok, 'Actual response is different from expected response.') # prepare round-trip
n_request = ConvertGeoJsonRequest(to_crs=LAS, feature_collection=api_response.feature_collection)
print('N-BodyRequest:\n%s' % n_request)
print('data_partition_header:\n%s' % data_partition_header)
api_response = self.api_instance.convert_geo_json(body=n_request, data_partition_id=data_partition_header)
self.assertIsNotNone(api_response)
self.assertEquals(api_response.feature_collection.type, 'AnyCrsFeatureCollection')
c = CompareResponseWithExpectation(api_response.feature_collection, expected=request.feature_collection)
ok = c.compare_feature_collections()
self.assertTrue(ok, 'Actual response is different from expected response.')
except ApiException as e:
print('Exception when calling ConvertGeo Api: '+e)
logging.info('Exception when calling ConvertGeo Api: '+e)
self.fail(str(e))
#except ApiException as e: #except ApiException as e:
# self.fail(str(e)) # self.fail(str(e))
......
...@@ -61,6 +61,7 @@ class CRSPointConversionApi(object): ...@@ -61,6 +61,7 @@ class CRSPointConversionApi(object):
returns the request thread. returns the request thread.
""" """
kwargs['_return_http_data_only'] = True kwargs['_return_http_data_only'] = True
print("ConvertGeo Callback Url:"+kwargs.get('callback'))
if kwargs.get('callback'): if kwargs.get('callback'):
return self.convert_geo_json_with_http_info(**kwargs) return self.convert_geo_json_with_http_info(**kwargs)
else: else:
...@@ -132,7 +133,10 @@ class CRSPointConversionApi(object): ...@@ -132,7 +133,10 @@ class CRSPointConversionApi(object):
# Authentication setting # Authentication setting
auth_settings = ['Bearer'] auth_settings = ['Bearer']
print("API Header Params Partition Id:"+header_params['data-partition-id'])
print("All Header Params:"+header_params)
print("API Body Params:"+body_params)
print("API callback:"+params.get('callback'))
return self.api_client.call_api(resource_path, 'POST', return self.api_client.call_api(resource_path, 'POST',
path_params, path_params,
query_params, query_params,
......