Ejemplo n.º 1
0
def _default_record_decoders():
    decoders = {}

    decoders['acknowledgement'] = AcknowledgementDictionaryDecoder()
    decoders['message'] = MessageDictionaryDecoder()
    decoders['agreement'] = AgreementDictionaryDecoder()
    decoders['territory_in_agreement'] = AgreementTerritoryDictionaryDecoder()
    decoders['additional_related_information'] = \
        AdditionalRelatedInformationDictionaryDecoder()
    decoders['group_header'] = GroupHeaderDictionaryDecoder()
    decoders['group_trailer'] = GroupTrailerDictionaryDecoder()
    decoders['group_trailer_base'] = GroupTrailerDictionaryDecoder()
    decoders['group_trailer_short'] = GroupTrailerDictionaryDecoder()
    decoders['interested_party_agreement'] = \
        InterestedPartyForAgreementDictionaryDecoder()
    decoders['nra_agreement_party'] = \
        NonRomanAlphabetAgreementPartyDictionaryDecoder()
    decoders['nra_publisher_name'] = \
        NonRomanAlphabetPublisherNameDictionaryDecoder()
    decoders['nra_writer_name'] = NonRomanAlphabetWriterNameDictionaryDecoder()
    decoders['nra_title'] = NonRomanAlphabetTitleDictionaryDecoder()
    decoders['nra_performance_data'] = \
        NonRomanAlphabetPerformanceDataDictionaryDecoder()
    decoders['nra_work'] = NonRomanAlphabetWorkDictionaryDecoder()
    decoders['nra_other_writer'] = \
        NonRomanAlphabetOtherWriterDictionaryDecoder()
    decoders['publisher'] = PublisherRecordDictionaryDecoder()
    decoders['publisher_territory'] = IPTerritoryOfControlDictionaryDecoder()
    decoders['transmission_header'] = TransmissionHeaderDictionaryDecoder()
    decoders['transmission_trailer'] = TransmissionTrailerDictionaryDecoder()
    decoders['work'] = WorkDictionaryDecoder()
    decoders['work_conflict'] = WorkDictionaryDecoder()
    decoders['work_alternate_title'] = AlternateTitleDictionaryDecoder()
    decoders['entire_work_title'] = AuthoredWorkDictionaryDecoder()
    decoders['original_work_title'] = AuthoredWorkDictionaryDecoder()
    decoders['performing_artist'] = PerformingArtistDictionaryDecoder()
    decoders['recording_detail'] = RecordingDetailDictionaryDecoder()
    decoders['work_origin'] = WorkOriginDictionaryDecoder()
    decoders['instrumentation_summary'] = \
        InstrumentationSummaryDictionaryDecoder()
    decoders['instrumentation_detail'] = \
        InstrumentationDetailDictionaryDecoder()
    decoders['component'] = ComponentDictionaryDecoder()
    decoders['writer'] = WriterRecordDictionaryDecoder()
    decoders['writer_publisher'] = PublisherForWriterDictionaryDecoder()
    decoders['writer_territory'] = IPTerritoryOfControlDictionaryDecoder()
    decoders['filename_new'] = FileTagDictionaryDecoder()
    decoders['filename_old'] = FileTagDictionaryDecoder()

    return decoders
Ejemplo n.º 2
0
class TestRecordingDetailDictionaryDecoder(unittest.TestCase):
    def setUp(self):
        self._decoder = RecordingDetailDictionaryDecoder()

    def test_encoded(self):
        data = {}

        data['record_type'] = 'REC'
        data['transaction_sequence_n'] = 3
        data['record_sequence_n'] = 15
        data['first_release_date'] = datetime.datetime.strptime(
            '20030216', '%Y%m%d').date()
        data['first_release_duration'] = datetime.datetime.strptime(
            '011200', '%H%M%S').time()
        data['first_album_title'] = 'FIRST TITLE'
        data['first_album_label'] = 'FIRST LABEL'
        data['first_release_catalog_n'] = 'ABF35'
        data['ean'] = 1234567890123
        data['isrc'] = 'ES-A2B-12-12'
        data['recording_format'] = 'V'
        data['recording_technique'] = 'D'
        data['media_type'] = 'CES'

        record = self._decoder.decode(data)

        self.assertEqual('REC', record.record_type)
        self.assertEqual(3, record.transaction_sequence_n)
        self.assertEqual(15, record.record_sequence_n)
        self.assertEqual(
            datetime.datetime.strptime('20030216', '%Y%m%d').date(),
            record.first_release_date)
        self.assertEqual(
            datetime.datetime.strptime('011200', '%H%M%S').time(),
            record.first_release_duration)
        self.assertEqual('FIRST TITLE', record.first_album_title)
        self.assertEqual('FIRST LABEL', record.first_album_label)
        self.assertEqual('ABF35', record.first_release_catalog_n)
        self.assertEqual(1234567890123, record.ean)
        self.assertEqual('ES-A2B-12-12', record.isrc)
        self.assertEqual('V', record.recording_format)
        self.assertEqual('D', record.recording_technique)
        self.assertEqual('CES', record.media_type)
Ejemplo n.º 3
0
class TestRecordingDetailDictionaryDecoder(unittest.TestCase):
    def setUp(self):
        self._decoder = RecordingDetailDictionaryDecoder()

    def test_encoded(self):
        data = {}

        data['record_type'] = 'REC'
        data['transaction_sequence_n'] = 3
        data['record_sequence_n'] = 15
        data['first_release_date'] = datetime.datetime.strptime('20030216',
                                                                '%Y%m%d').date()
        data['first_release_duration'] = datetime.datetime.strptime('011200',
                                                                    '%H%M%S').time()
        data['first_album_title'] = 'FIRST TITLE'
        data['first_album_label'] = 'FIRST LABEL'
        data['first_release_catalog_n'] = 'ABF35'
        data['ean'] = 1234567890123
        data['isrc'] = 'ES-A2B-12-12'
        data['recording_format'] = 'V'
        data['recording_technique'] = 'D'
        data['media_type'] = 'CES'

        record = self._decoder.decode(data)

        self.assertEqual('REC', record.record_type)
        self.assertEqual(3, record.transaction_sequence_n)
        self.assertEqual(15, record.record_sequence_n)
        self.assertEqual(
            datetime.datetime.strptime('20030216', '%Y%m%d').date(),
            record.first_release_date)
        self.assertEqual(datetime.datetime.strptime('011200', '%H%M%S').time(),
                         record.first_release_duration)
        self.assertEqual('FIRST TITLE', record.first_album_title)
        self.assertEqual('FIRST LABEL', record.first_album_label)
        self.assertEqual('ABF35', record.first_release_catalog_n)
        self.assertEqual(1234567890123, record.ean)
        self.assertEqual('ES-A2B-12-12', record.isrc)
        self.assertEqual('V', record.recording_format)
        self.assertEqual('D', record.recording_technique)
        self.assertEqual('CES', record.media_type)
Ejemplo n.º 4
0
 def setUp(self):
     self._decoder = RecordingDetailDictionaryDecoder()
Ejemplo n.º 5
0
 def setUp(self):
     self._decoder = RecordingDetailDictionaryDecoder()