Commit 84a046ea authored by Paul Graydon's avatar Paul Graydon

ors_wendelin_test: Clean up

parent 1ad709c4
...@@ -43,7 +43,7 @@ class ORSWendelinTest(SecurityTestCase): ...@@ -43,7 +43,7 @@ class ORSWendelinTest(SecurityTestCase):
def afterSetUp(self): def afterSetUp(self):
# Set up variables for ORS ingestion testing # Set up variables for ORS ingestion testing
self.ors_ingestion = self.portal.portal_ingestion_policies.ors_ingestion self.ors_enb_log_ingestion = self.portal.portal_ingestion_policies.ors_enb_log_ingestion
self.test_ors_example_log_valid = {'log': self.portal.web_page_module.test_ors_example_log_valid.getTextContent()} self.test_ors_example_log_valid = {'log': self.portal.web_page_module.test_ors_example_log_valid.getTextContent()}
self.test_ors_example_log_invalid = {'log': self.portal.web_page_module.test_ors_example_log_invalid.getTextContent()} self.test_ors_example_log_invalid = {'log': self.portal.web_page_module.test_ors_example_log_invalid.getTextContent()}
...@@ -119,7 +119,7 @@ class ORSWendelinTest(SecurityTestCase): ...@@ -119,7 +119,7 @@ class ORSWendelinTest(SecurityTestCase):
data_supply = None data_supply = None
if data_acquisition_unit: if data_acquisition_unit:
data_supply = data_acquisition_unit.DataAcquisitionUnit_createORSDataSupply(batch=1) data_supply = data_acquisition_unit.DataAcquisitionUnit_createOrsDataSupply(batch=1)
# Return all associated objects # Return all associated objects
return { return {
...@@ -134,7 +134,7 @@ class ORSWendelinTest(SecurityTestCase): ...@@ -134,7 +134,7 @@ class ORSWendelinTest(SecurityTestCase):
# Simulate a fluentd instance sending the given log data to Wendelin for ingestion # Simulate a fluentd instance sending the given log data to Wendelin for ingestion
body = msgpack.packb([0, log_data], use_bin_type=True) body = msgpack.packb([0, log_data], use_bin_type=True)
env = {'CONTENT_TYPE': 'application/octet-stream'} env = {'CONTENT_TYPE': 'application/octet-stream'}
path = self.ors_ingestion.getPath() + '/ingest?reference=' + reference path = self.ors_enb_log_ingestion.getPath() + '/ingest?reference=' + reference
publish_kw = dict(user='ERP5TypeTestCase', env=env, publish_kw = dict(user='ERP5TypeTestCase', env=env,
request_method='POST', stdin=StringIO(body)) request_method='POST', stdin=StringIO(body))
return self.publish(path, **publish_kw) return self.publish(path, **publish_kw)
...@@ -168,7 +168,7 @@ class ORSWendelinTest(SecurityTestCase): ...@@ -168,7 +168,7 @@ class ORSWendelinTest(SecurityTestCase):
# Retrieve all items linked to the ingestion # Retrieve all items linked to the ingestion
data_acquisition_unit = self.portal.portal_catalog.getResultValue(portal_type='Data Acquisition Unit', reference=reference) data_acquisition_unit = self.portal.portal_catalog.getResultValue(portal_type='Data Acquisition Unit', reference=reference)
data_supply = data_acquisition_unit.DataAcquisitionUnit_createORSDataSupply(batch=1) data_supply = data_acquisition_unit.DataAcquisitionUnit_createOrsDataSupply(batch=1)
self.tic() self.tic()
data_stream = self._getDataStream(data_acquisition_unit) data_stream = self._getDataStream(data_acquisition_unit)
...@@ -274,7 +274,7 @@ class ORSWendelinTest(SecurityTestCase): ...@@ -274,7 +274,7 @@ class ORSWendelinTest(SecurityTestCase):
self.tic() self.tic()
# Call the tested script which creates a related Data Supply # Call the tested script which creates a related Data Supply
data_supply = data_acquisition_unit.DataAcquisitionUnit_createORSDataSupply(batch=1) data_supply = data_acquisition_unit.DataAcquisitionUnit_createOrsDataSupply(batch=1)
self.tic() self.tic()
# Check that the Data Supply exists and is validated # Check that the Data Supply exists and is validated
...@@ -394,7 +394,7 @@ class ORSWendelinTest(SecurityTestCase): ...@@ -394,7 +394,7 @@ class ORSWendelinTest(SecurityTestCase):
self.assertTrue(data_acquisition_unit is not None) self.assertTrue(data_acquisition_unit is not None)
# Check that the Data Supply exists and is validated # Check that the Data Supply exists and is validated
data_supply = data_acquisition_unit.DataAcquisitionUnit_createORSDataSupply(batch=1) data_supply = data_acquisition_unit.DataAcquisitionUnit_createOrsDataSupply(batch=1)
self.assertTrue(data_supply is not None) self.assertTrue(data_supply is not None)
# Generate new references # Generate new references
...@@ -415,7 +415,7 @@ class ORSWendelinTest(SecurityTestCase): ...@@ -415,7 +415,7 @@ class ORSWendelinTest(SecurityTestCase):
self.assertTrue(new_data_acquisition_unit is not None) self.assertTrue(new_data_acquisition_unit is not None)
# Check that the Data Supply exists and is validated # Check that the Data Supply exists and is validated
new_data_supply = new_data_acquisition_unit.DataAcquisitionUnit_createORSDataSupply(batch=1) new_data_supply = new_data_acquisition_unit.DataAcquisitionUnit_createOrsDataSupply(batch=1)
self.assertTrue(new_data_supply is not None) self.assertTrue(new_data_supply is not None)
# Add another ORS to the project, with the same reference and a new title # Add another ORS to the project, with the same reference and a new title
...@@ -453,8 +453,8 @@ class ORSWendelinTest(SecurityTestCase): ...@@ -453,8 +453,8 @@ class ORSWendelinTest(SecurityTestCase):
self.assertTrue(all(data_array is not None for data_array in ingestion_objects['data_arrays'])) self.assertTrue(all(data_array is not None for data_array in ingestion_objects['data_arrays']))
# Check that the data arrays containing the KPI data have correctly been initialized # Check that the data arrays containing the KPI data have correctly been initialized
self.assertTrue(ingestion_objects['data_acquisition_unit'].Base_getERABDataArrayKey() is not None) self.assertTrue(ingestion_objects['data_acquisition_unit'].Base_getERabDataArrayKey() is not None)
self.assertTrue(ingestion_objects['data_acquisition_unit'].Base_getEUTRANDataArrayKey() is not None) self.assertTrue(ingestion_objects['data_acquisition_unit'].Base_getEUtranDataArrayKey() is not None)
if valid_data: if valid_data:
# If all data is valid: check that the arrays contain some data # If all data is valid: check that the arrays contain some data
...@@ -506,7 +506,7 @@ class ORSWendelinTest(SecurityTestCase): ...@@ -506,7 +506,7 @@ class ORSWendelinTest(SecurityTestCase):
) )
data_acquisition_unit.validate() data_acquisition_unit.validate()
self.tic() self.tic()
data_supply = data_acquisition_unit.DataAcquisitionUnit_createORSDataSupply(batch=1) data_supply = data_acquisition_unit.DataAcquisitionUnit_createOrsDataSupply(batch=1)
self.tic() self.tic()
# Force update on local roles to ensure proper permissions # Force update on local roles to ensure proper permissions
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment