"""Pytest conftest module.""" from ddex_ingester_common.models.s3.asset import ( Asset ) from ddex_ingester_common.models.state_machine.product import ( Product ) import pytest @pytest.fixture def s3_object(): """Context object representing DDEX data.""" return { 'product': { 'product_id': 2851194, 'status': 'in_content', 'display_artist_name': 'Cool Artist', 'upc': '886448369561', 'is_main_release': True, 'release_reference': 'R0', 'artwork': { 'filename': 'A10301A0004280500R_T-1205814372821_Image.tif', 'filepath': 'resources/', }, 'release_type': 'Album', 'original_release_date': None, 'sale_start_date': None, 'grid': 'A0145345234523453452', 'catalog_number': 'G0134523452345245', 'product_name': 'Test Artist', 'not_for_distribution': 'N', 'genres': [ { 'genre': 'ELECTRONICA-00', 'subgenre': 'Alternative' } ], }, 'tracks': None, 'key': 'folder/subfolder/', 'bucket': 'ddex-bucket', 'deals': None, 'message_id': '12345', 'message_thread_id': '12345_TEST', 'party_id': 'PADPIDA2012041004F', 'update_indicator': 'OriginalMessage', 'error_correction': { 'release_correction_id': 287202, 'release_id': 2851194, 'items': [], } } @pytest.fixture def product_object(asset_object): """Product object.""" return Product( **{ 'vendor_id': 123, 'subaccount_id': 123, 'release_reference': 'R0', 'upc': '886448369561', 'display_artist': None, 'is_main_release': True, 'product_id': 12345, 'artwork': asset_object, 'release_type': 'Album', 'sale_start_date': None, 'original_release_date': None, } ) @pytest.fixture def asset_object(): """Asset object.""" return Asset( **{ 'filename': 'artwork.tif', 'filepath': 'resources/', 'bucket': 'ddex-bucket', 'key': 'folder/subfolder/resources/artwork.tif', 'ows_assets_filename': None } ) @pytest.fixture def error_correction_object(): """Error correction object.""" return { 'release_id': 2851194, 'release_correction_id': 287202, 'items': [ { 'release_correction_detail_id': 4203813, 'field_name': 'coverart', 'key_value': 'true', 'key_id': 2851194, 'table_name': 'releases', } ], } @pytest.fixture def correction_detail_object(): """Correction detail object.""" return { 'correctionDetailId': 4203813, 'keyId': 2851194, 'keyValue': 'true', 'tableName': 'releases', 'fieldName': 'coverart', }