"""Configuration file for pytest. This file gets picked up when running py.test tests: http://pytest.org/latest/writing_plugins.html#conftest """ import pytest @pytest.fixture def participant_no_contributor(): """Track with a single participant.""" return { 'ids': [{'system': 'SONY', 'localId': 'D1631147620131205:'}], 'isrc': 'USSM11307800', 'grid': None, 'displayTitle': 'TrackdDsplayTitle1', 'formalTitle': {'titleText': 'TrackFormalTitle1', 'subTitle': None}, 'displayArtists': [ { 'sequenceNumber': None, 'participant': { 'ids': [ { 'localId': '1', 'system': 'SONY' } ], 'name': 'David Bowie', 'members': [] }, 'role': 'Primary' } ], 'contributors': [], 'metaLanguage': 'en', 'lyrics': 'Lyrics track 1', 'trackMedia': 'AUDIO', 'trackType': 'TRACK', 'videoType': None, 'masterOwnershipType': 'DISTRIBUTED', 'durationInSeconds': 323, 'parentalWarningType': 'EXPLICIT', 'pLine': {'pLineText': '(p) 2013 Columbia Records, ' 'a Division of Sony Music Entertainment'}, 'recordingCountry': 'NL', 'copyrightOwnerCountry': 'BE', 'labelAccount': {'companyCode': '15063'}, } @pytest.fixture def no_participant(): """Track with no participants.""" return { 'ids': [{'system': 'SONY', 'localId': 'D1631147620131205:'}], 'isrc': 'USSM11307800', 'grid': None, 'displayTitle': 'TrackdDsplayTitle1', 'formalTitle': { 'titleText': 'TrackFormalTitle1', 'subTitle': None }, 'displayArtists': [], 'contributors': [], 'metaLanguage': 'en', 'lyrics': 'Lyrics track 1', 'trackMedia': 'AUDIO', 'trackType': 'TRACK', 'videoType': None, 'masterOwnershipType': 'DISTRIBUTED', 'durationInSeconds': 323, 'parentalWarningType': 'EXPLICIT', 'pLine': { 'pLineText': '(p) 2013 Columbia Records, ' 'a Division of Sony Music Entertainment'}, 'recordingCountry': 'NL', 'copyrightOwnerCountry': 'BE', 'labelAccount': {'companyCode': '15063'}, } @pytest.fixture def participant_primary_contribution(): """Track with a single participant with a primary contribution.""" return { 'ids': [{'system': 'SONY', 'localId': 'D1631147620131205:'}], 'isrc': 'USSM11307800', 'grid': None, 'displayTitle': 'TrackdDsplayTitle1', 'formalTitle': {'titleText': 'TrackFormalTitle1', 'subTitle': None}, 'displayArtists': [ { 'sequenceNumber': None, 'participant': { 'ids': [ {'localId': '1', 'system': 'SONY' } ], 'name': 'David Bowie', 'members': [] }, 'role': 'Primary'} ], 'contributors': [ { 'sequenceNumber': None, 'participant': { 'ids': [ { 'localId': '1', 'system': 'SONY' } ], 'name': 'David \'What You Doin in Space Man\' Bowie', 'members': [] }, 'role': 'Voice' } ], 'metaLanguage': 'en', 'lyrics': 'Lyrics track 1', 'trackMedia': 'AUDIO', 'trackType': 'TRACK', 'videoType': None, 'masterOwnershipType': 'DISTRIBUTED', 'durationInSeconds': 323, 'parentalWarningType': 'EXPLICIT', 'pLine': { 'pLineText': '(p) 2013 Columbia Records, a Division of Sony ' 'Music Entertainment'}, 'recordingCountry': 'NL', 'copyrightOwnerCountry': 'BE', 'labelAccount': {'companyCode': '15063'}, } @pytest.fixture def participant_featured_contribution(): """Track with a single participant with a featured contribution.""" return { 'ids': [{'system': 'SONY', 'localId': 'D1631147620131205:'}], 'isrc': 'USSM11307800', 'grid': None, 'displayTitle': 'TrackdDsplayTitle1', 'formalTitle': { 'titleText': 'TrackFormalTitle1', 'subTitle': None }, 'displayArtists': [ { 'sequenceNumber': None, 'participant': { 'ids': [ { 'localId': '1', 'system': 'SONY' } ], 'name': 'David Bowie', 'members': [] }, 'role': 'Featured' } ], 'contributors': [ { 'sequenceNumber': None, 'participant': { 'ids': [ { 'localId': '1', 'system': 'SONY' } ], 'name': 'David \'What You Doin in Space Man\' Bowie', 'members': [] }, 'role': 'Voice' } ], 'metaLanguage': 'en', 'lyrics': 'Lyrics track 1', 'trackMedia': 'AUDIO', 'trackType': 'TRACK', 'videoType': None, 'masterOwnershipType': 'DISTRIBUTED', 'durationInSeconds': 323, 'parentalWarningType': 'EXPLICIT', 'pLine': { 'pLineText': '(p) 2013 Columbia Records, ' 'a Division of Sony Music Entertainment'}, 'recordingCountry': 'NL', 'copyrightOwnerCountry': 'BE', 'labelAccount': {'companyCode': '15063'}, } @pytest.fixture def participant_with_primary_and_featuring_contribution(): """Track with a single participant with a primary and featuring contribution.""" # noqa return { 'ids': [{'system': 'SONY', 'localId': 'D1631147620131205:'}], 'isrc': 'USSM11307800', 'grid': None, 'displayTitle': 'TrackdDsplayTitle1', 'formalTitle': {'titleText': 'TrackFormalTitle1', 'subTitle': None}, 'displayArtists': [ { 'sequenceNumber': None, 'participant': { 'ids': [ {'localId': '1', 'system': 'SONY' } ], 'name': 'David Bowie', 'members': [] }, 'role': 'Primary' }, { 'sequenceNumber': None, 'participant': { 'ids': [ { 'localId': '1', 'system': 'SONY' } ], 'name': 'David Bowie', 'members': [] }, 'role': 'FeaturedArtist' } ], 'contributors': [ { 'sequenceNumber': None, 'participant': { 'ids': [ { 'localId': '1', 'system': 'SONY' } ], 'name': 'David \'What You Doin in Space Man\' Bowie', 'members': [] }, 'role': 'Voice' } ], 'metaLanguage': 'en', 'lyrics': 'Lyrics track 1', 'trackMedia': 'AUDIO', 'trackType': 'TRACK', 'videoType': None, 'masterOwnershipType': 'DISTRIBUTED', 'durationInSeconds': 323, 'parentalWarningType': 'EXPLICIT', 'pLine': { 'pLineText': '(p) 2013 Columbia Records, a Division of Sony ' 'Music Entertainment'}, 'recordingCountry': 'NL', 'copyrightOwnerCountry': 'BE', 'labelAccount': {'companyCode': '15063'}, } @pytest.fixture def participant_with_featuring_and_non_featuring_contribution(): """Track with a single participant with a featuring role, not featuring and non featuring contribution.""" # noqa return { 'ids': [{'system': 'SONY', 'localId': 'D1631147620131205:'}], 'isrc': 'USSM11307800', 'grid': None, 'displayTitle': 'TrackdDsplayTitle1', 'formalTitle': {'titleText': 'TrackFormalTitle1', 'subTitle': None}, 'displayArtists': [ { 'sequenceNumber': None, 'participant': { 'ids': [ { 'localId': '1', 'system': 'SONY' } ], 'name': 'David Bowie', 'members': [] }, 'role': 'FeaturedArtist' }, # This would probably never happen in real data but # we are defending against it { 'sequenceNumber': None, 'participant': { 'ids': [ { 'localId': '1', 'system': 'SONY' } ], 'name': 'David Bowie', 'members': [] }, 'role': 'Piano' } ], 'contributors': [ { 'sequenceNumber': None, 'participant': { 'ids': [ { 'localId': '1', 'system': 'SONY' } ], 'name': 'David \'What You Doin in Space Man\' Bowie', 'members': [] }, 'role': 'Voice' } ], 'metaLanguage': 'en', 'lyrics': 'Lyrics track 1', 'trackMedia': 'AUDIO', 'trackType': 'TRACK', 'videoType': None, 'masterOwnershipType': 'DISTRIBUTED', 'durationInSeconds': 323, 'parentalWarningType': 'EXPLICIT', 'pLine': { 'pLineText': '(p) 2013 Columbia Records, a Division of Sony ' 'Music Entertainment'}, 'recordingCountry': 'NL', 'copyrightOwnerCountry': 'BE', 'labelAccount': {'companyCode': '15063'}, } @pytest.fixture def participant_primary_contribution_with_specific_role(): """Track with a single participant with a primary contribution but specific role (Voice).""" # noqa return { 'ids': [{'system': 'SONY', 'localId': 'D1631147620131205:'}], 'isrc': 'USSM11307800', 'grid': None, 'displayTitle': 'TrackdDsplayTitle1', 'formalTitle': {'titleText': 'TrackFormalTitle1', 'subTitle': None}, 'displayArtists': [ { 'sequenceNumber': None, 'participant': { 'ids': [ {'localId': '1', 'system': 'SONY' } ], 'name': 'David Bowie', 'members': [] }, 'role': 'Primary'} ], 'contributors': [ { 'sequenceNumber': None, 'participant': { 'ids': [ { 'localId': '1', 'system': 'SONY' } ], 'name': 'David Bowie', 'members': [] }, 'role': 'Voice' }, { 'sequenceNumber': None, 'participant': { 'ids': [ { 'localId': '1', 'system': 'SONY' } ], 'name': 'David Bowie', 'members': [] }, 'role': 'OriginalArtist' } ], 'metaLanguage': 'en', 'lyrics': 'Lyrics track 1', 'trackMedia': 'AUDIO', 'trackType': 'TRACK', 'videoType': None, 'masterOwnershipType': 'DISTRIBUTED', 'durationInSeconds': 323, 'parentalWarningType': 'EXPLICIT', 'pLine': { 'pLineText': '(p) 2013 Columbia Records, a Division of Sony ' 'Music Entertainment'}, 'recordingCountry': 'NL', 'copyrightOwnerCountry': 'BE', 'labelAccount': {'companyCode': '15063'}, } @pytest.fixture def participant_primary_contribution_with_duplicates(): """Track with a single participant with a primary contribution but specific role (Voice).""" # noqa return { 'ids': [{'system': 'SONY', 'localId': 'D1631147620131205:'}], 'isrc': 'USSM11307800', 'grid': None, 'displayTitle': 'TrackdDsplayTitle1', 'formalTitle': {'titleText': 'TrackFormalTitle1', 'subTitle': None}, 'displayArtists': [ { 'sequenceNumber': None, 'participant': { 'ids': [ {'localId': '1', 'system': 'SONY' } ], 'name': 'David Bowie', 'members': [] }, 'role': 'Primary'} ], 'contributors': [ { 'sequenceNumber': None, 'participant': { 'ids': [ { 'localId': '1', 'system': 'SONY' } ], 'name': 'David Bowie', 'members': [] }, 'role': 'Performer' }, { 'sequenceNumber': None, 'participant': { 'ids': [ { 'localId': '1', 'system': 'SONY' } ], 'name': 'David Bowie', 'members': [] }, 'role': 'OriginalArtist' } ], 'metaLanguage': 'en', 'lyrics': 'Lyrics track 1', 'trackMedia': 'AUDIO', 'trackType': 'TRACK', 'videoType': None, 'masterOwnershipType': 'DISTRIBUTED', 'durationInSeconds': 323, 'parentalWarningType': 'EXPLICIT', 'pLine': { 'pLineText': '(p) 2013 Columbia Records, a Division of Sony ' 'Music Entertainment'}, 'recordingCountry': 'NL', 'copyrightOwnerCountry': 'BE', 'labelAccount': {'companyCode': '15063'}, } @pytest.fixture def compound_performers_with_non_featuring_contributions(): """A track with valid compound performers that should class as having non featuring performances.""" # noqa return {'ids': [ { 'localId': 'W1356557620191113:', 'system': 'SONY' } ], 'isrc': 'GBHQD1900137', 'grid': None, 'displayTitle': 'Zeta', 'formalTitle': { 'titleText': 'Zeta', 'subTitle': 'Group with Original and Replacement Members' }, 'displayArtists': [ { 'sequenceNumber': 1, 'participant': { 'ids': [ { 'localId': '35621', 'system': 'SONY' } ], 'name': 'Ramones', 'members': [{ 'sequenceNumber': 1, 'role': 'Original', 'participant': { 'ids': [ { 'localId': '34226', 'system': 'SONY' } ], 'name': 'Joey Ramone' } }, { 'sequenceNumber': 2, 'role': 'Original', 'participant': { 'ids': [ { 'localId': '34227', 'system': 'SONY' } ], 'name': 'Johnny Ramone' } }, { 'sequenceNumber': 3, 'role': 'Replacement', 'participant': { 'ids': [ { 'localId': '1070568', 'system': 'SONY' } ], 'name': 'C.J. Ramone' } }, { 'sequenceNumber': 4, 'role': 'Replacement', 'participant': { 'ids': [ { 'localId': '34228', 'system': 'SONY' } ], 'name': 'Marky Ramone' } } ] }, 'role': 'Performer' } ], 'contributors': [ { 'sequenceNumber': 1, 'participant': { 'ids': [ { 'localId': '34228', 'system': 'SONY' } ], 'name': 'Marky Ramone', 'members': [] }, 'role': 'Drums' }, { 'sequenceNumber': 2, 'participant': { 'ids': [ { 'localId': '34227', 'system': 'SONY' } ], 'name': 'Johnny Ramone', 'members': [] }, 'role': 'Voice' } ], 'publishers': [], 'samples': None, 'labelAccount': None, 'metaLanguage': None, 'lyrics': None, 'trackMedia': 'AUDIO', 'trackType': 'TRACK', 'videoType': None, 'durationInSeconds': 0, 'parentalWarningType': 'EXPLICIT', 'pLine': { 'pLineText': None }, 'recordingCountry': None }