New paste Repaste Download
============================= test session starts ==============================
platform linux -- Python 3.11.8, pytest-8.0.2, pluggy-1.4.0 -- /usr/local/bin/python3
cachedir: /tmp
rootdir: /scripts/pxq-tests
plugins: allure-pytest-2.13.2, django-4.8.0
collecting ... collected 16 items
scripts/pxq-tests/test_interpolation.py::TestClass::test_file_exists_electricity_interpolation PASSED
scripts/pxq-tests/test_interpolation.py::TestClass::test_file_exists_gas_interpolation PASSED
scripts/pxq-tests/test_interpolation.py::TestClass::test_file_exists_gas_start_date_interpolation PASSED
scripts/pxq-tests/test_interpolation.py::TestClass::test_file_exists_gas_end_date_interpolation PASSED
scripts/pxq-tests/test_interpolation.py::TestClass::test_validate_electricity_interpolation PASSED
scripts/pxq-tests/test_interpolation.py::TestClass::test_validate_gas_interpolation PASSED
scripts/pxq-tests/test_interpolation.py::TestClass::test_validate_gas_start_date_interpolation PASSED
scripts/pxq-tests/test_interpolation.py::TestClass::test_validate_gas_end_date_interpolation FAILED
scripts/pxq-tests/test_meter_changes.py::TestClass::test_validate_electricity_meter_changes PASSED
scripts/pxq-tests/test_meter_changes.py::TestClass::test_validate_gas_meter_changes PASSED
scripts/pxq-tests/test_output.py::TestClass::test_file_exists_electricity PASSED
scripts/pxq-tests/test_output.py::TestClass::test_file_exists_gas PASSED
scripts/pxq-tests/test_output.py::TestClass::test_file_exists_gas_corrected PASSED
scripts/pxq-tests/test_output.py::TestClass::test_validate_output_json PASSED
scripts/pxq-tests/test_output.py::TestClass::test_validate_output_json_gas PASSED
scripts/pxq-tests/test_output.py::TestClass::test_validate_output_json_gas_corrected PASSED
=================================== FAILURES ===================================
______________ TestClass.test_validate_gas_end_date_interpolation ______________
self = <test_interpolation.TestClass object at 0x7fb8e5aa1710>
kafka_output_json_gas_end_date_no_readings = {'containsPrivacyData': True, 'data': {'request': {'endTimestamp': '2023-05-30T00:00:00+02:00', 'meterReadings': [], '...lse, 'metrics': {'ratioInterpolated': 0.0027778}, ...}}, 'eventName': 'DynamicPricingEvent', 'eventSource': 'PXQ', ...}
expected_customer_consumption_gas_end_date_interpolated = {'containsPrivacyData': True, 'data': {'request': {'endTimestamp': '2023-05-30T00:00:00+02:00', 'meterReadings': [], '...lse, 'metrics': {'ratioInterpolated': 0.0027778}, ...}}, 'eventName': 'DynamicPricingEvent', 'eventSource': 'PXQ', ...}
    def test_validate_gas_end_date_interpolation(self,kafka_output_json_gas_end_date_no_readings, expected_customer_consumption_gas_end_date_interpolated):
        kafka_output_json_gas_end_date_no_readings = remove_id_timestamp_tags(kafka_output_json_gas_end_date_no_readings)
>       assert expected_customer_consumption_gas_end_date_interpolated == kafka_output_json_gas_end_date_no_readings
E       AssertionError: assert {'eventName': 'DynamicPricingEvent', 'eventSource': 'PXQ', 'eventSubject': {'label': 'ENECO', 'customerId': 11225375, 'accountId': 1, 'agreementId': 37952684, 'connectionPointEan': '871668227714225375'}, 'containsPrivacyData': True, 'data': {'request': {'referenceId': 'AAAA', 'startTimestamp': '2023-05-15T00:00:00+02:00', 'endTimestamp': '2023-05-30T00:00:00+02:00', 'meterReadings': []}, 'response': {'isCorrection': False, 'prices': [{'code': 'M3GAS', 'wholesalePriceExclVat': 4.1890075, 'correctedWholesalePriceExclVat': None}], 'startMeterReading': {'timestamp': '2023-05-15T00:00:00+02:00', 'readings': [{'code': 'M3GAS', 'reading': 4340.0, 'correctedReading': None}]}, 'endMeterReading': {'timestamp': '2023-05-30T00:00:00+02:00', 'readings': [{'code': 'M3GAS', 'reading': 4355.0, 'correctedReading': None}]}, 'volumes': [{'code': 'M3GAS', 'volume': 15.0, 'correctedVolume': None, 'caloricFactor': 1.03081, 'correctedCaloricFactor': None, 'averageTariff': 0.2792672, 'correctedAverageTariff': None}], 'errors': [], 'metrics': {'ratioInterpolated': 0.0027778}}}} == {'eventName': 'DynamicPricingEvent', 'eventSource': 'PXQ', 'eventSubject': {'label': 'ENECO', 'customerId': 11225375, 'accountId': 1, 'agreementId': 37952684, 'connectionPointEan': '871668227714225375'}, 'containsPrivacyData': True, 'data': {'request': {'referenceId': 'AAAA', 'startTimestamp': '2023-05-15T00:00:00+02:00', 'endTimestamp': '2023-05-30T00:00:00+02:00', 'meterReadings': []}, 'response': {'isCorrection': False, 'prices': [{'code': 'M3GAS', 'wholesalePriceExclVat': 4.1050005, 'correctedWholesalePriceExclVat': None}], 'startMeterReading': {'timestamp': '2023-05-15T00:00:00+02:00', 'readings': [{'code': 'M3GAS', 'reading': 4340.0, 'correctedReading': None}]}, 'endMeterReading': {'timestamp': '2023-05-30T00:00:00+02:00', 'readings': [{'code': 'M3GAS', 'reading': 4355.0, 'correctedReading': None}]}, 'volumes': [{'code': 'M3GAS', 'volume': 15.0, 'correctedVolume': None, 'caloricFactor': 1.03081, 'correctedCaloricFactor': None, 'averageTariff': 0.2736667, 'correctedAverageTariff': None}], 'errors': [], 'metrics': {'ratioInterpolated': 0.0027778}}}}
E         
E         Common items:
E         {'containsPrivacyData': True,
E          'eventName': 'DynamicPricingEvent',
E          'eventSource': 'PXQ',
E          'eventSubject': {'accountId': 1,
E                           'agreementId': 37952684,
E                           'connectionPointEan': '871668227714225375',
E                           'customerId': 11225375,
E                           'label': 'ENECO'}}
E         Differing items:
E         {'data': {'request': {'endTimestamp': '2023-05-30T00:00:00+02:00', 'meterReadings': [], 'referenceId': 'AAAA', 'startT... '2023-05-30T00:00:00+02:00'}, 'errors': [], 'isCorrection': False, 'metrics': {'ratioInterpolated': 0.0027778}, ...}}} != {'data': {'request': {'endTimestamp': '2023-05-30T00:00:00+02:00', 'meterReadings': [], 'referenceId': 'AAAA', 'startT... '2023-05-30T00:00:00+02:00'}, 'errors': [], 'isCorrection': False, 'metrics': {'ratioInterpolated': 0.0027778}, ...}}}
E         
E         Full diff:
E           {
E               'containsPrivacyData': True,
E               'data': {
E                   'request': {
E                       'endTimestamp': '2023-05-30T00:00:00+02:00',
E                       'meterReadings': [],
E                       'referenceId': 'AAAA',
E                       'startTimestamp': '2023-05-15T00:00:00+02:00',
E                   },
E                   'response': {
E                       'endMeterReading': {
E                           'readings': [
E                               {
E                                   'code': 'M3GAS',
E                                   'correctedReading': None,
E                                   'reading': 4355.0,
E                               },
E                           ],
E                           'timestamp': '2023-05-30T00:00:00+02:00',
E                       },
E                       'errors': [],
E                       'isCorrection': False,
E                       'metrics': {
E                           'ratioInterpolated': 0.0027778,
E                       },
E                       'prices': [
E                           {
E                               'code': 'M3GAS',
E                               'correctedWholesalePriceExclVat': None,
E         -                     'wholesalePriceExclVat': 4.1050005,
E         ?                                                 ^^  ^
E         +                     'wholesalePriceExclVat': 4.1890075,
E         ?                                                 ^^  ^
E                           },
E                       ],
E                       'startMeterReading': {
E                           'readings': [
E                               {
E                                   'code': 'M3GAS',
E                                   'correctedReading': None,
E                                   'reading': 4340.0,
E                               },
E                           ],
E                           'timestamp': '2023-05-15T00:00:00+02:00',
E                       },
E                       'volumes': [
E                           {
E         -                     'averageTariff': 0.2736667,
E         ?                                          ^^^
E         +                     'averageTariff': 0.2792672,
E         ?                                          ^^  +
E                               'caloricFactor': 1.03081,
E                               'code': 'M3GAS',
E                               'correctedAverageTariff': None,
E                               'correctedCaloricFactor': None,
E                               'correctedVolume': None,
E                               'volume': 15.0,
E                           },
E                       ],
E                   },
E               },
E               'eventName': 'DynamicPricingEvent',
E               'eventSource': 'PXQ',
E               'eventSubject': {
E                   'accountId': 1,
E                   'agreementId': 37952684,
E                   'connectionPointEan': '871668227714225375',
E                   'customerId': 11225375,
E                   'label': 'ENECO',
E               },
E           }
scripts/pxq-tests/test_interpolation.py:101: AssertionError
---------------- generated xml file: /scripts/test_reports.xml -----------------
=========================== short test summary info ============================
FAILED scripts/pxq-tests/test_interpolation.py::TestClass::test_validate_gas_end_date_interpolation
========================= 1 failed, 15 passed in 0.43s =========================
Filename: None. Size: 9kb. View raw, , hex, or download this file.

This paste expires on 2024-04-02 09:20:49.421504. Pasted through deprecated-web.