"""Pytest conftest module.""" import pytest @pytest.fixture def context_success(): """Context fixture.""" return { 'status': 'Success', 'context': { 'product': { 'status': None, 'display_artist_name': 'Cool Artist', 'vendor_id': None, 'subaccount_id': None, 'upc': '231232563123', 'product_id': 234324, 'is_main_release': True, 'release_type': 'release', 'release_reference': 'R0', 'artwork': None, 'original_release_date': None, 'sale_start_date': None, 'grid': 'A10301A0004280500R', 'catalog_number': 'G0145345234524', 'product_name': 'Test Artist', 'genres': [ { 'genre': 'ELECTRONICA-00', 'subgenre': 'Alternative' } ], }, 'tracks': None, 'deals': [ { 'release_references': ['R1'], 'deal_terms': [ { 'start_date': None, 'start_date_time': '2020-03-27T04:00:00Z', 'territories': ['AE', 'BE'], 'usage_type': [ 'NonInteractiveStream', 'OnDemandStream' ], 'takedown': None, }, { 'start_date': '2020-03-25', 'start_date_time': None, 'territories': ['US', 'GB'], 'usage_type': [ 'NonInteractiveStream', 'OnDemandStream' ], 'takedown': None, }, ] } ], 'bucket': 'ddex-bucket', 'key': 'key', 'errors': None, 'message_id': '12345', 'message_thread_id': '12345_12345', 'party_id': 'PADPIDA2012041004F', 'update_indicator': 'OriginalMessage', 'execution_start_time': '2021-07-13T09:20:48.653Z', 'has_switchboard_deal': True } } @pytest.fixture def error_context(): """Error context fixture.""" return { 'status': 'Failure', 'context': { 'detail': { 'requestParameters': { 'bucketName': 'qa-ddex-ingester', 'key': 'sme_ddex/20201214203341552/A10301A00035480592.xml', }, }, 'errors': { 'Error': 'ExpatError', 'Cause': 'Something failed in XML parsing' }, 'has_switchboard_deal': True } } @pytest.fixture def ddex_xml(): """XML file fixture.""" return """ G010004580662G_TOC 222894344 PADPIDA2007040502I Sony Music Entertainment PADPIDA2012041004F Orchard, The 2021-07-12T06:52:17.931+02:00 LiveMessage A10301A00035480592 195497918690 G0100035480592 A10328E0007854993I QM4TW2122476 """