Пример #1
0
    def test_create_rights(self):
        testRightsRow = {
            'htid': 'test.000000',
            'rights': 'pd',
            'rights_statement': 'ipma',
            'rights_determination_date': '2019',
            'copyright_date': '1990'
        }

        rightsTest = HathiRecord(testRightsRow)
        rightsTest.createRights()
        self.assertIsInstance(rightsTest.rights, Rights)
        self.assertEqual(rightsTest.rights.license, 'public_domain')
Пример #2
0
    def test_build_data_model(self):
        testRow = {
            'title': 'Work Test',
            'description': '1st of 4',
            'bib_key': '0000000',
            'htid': 'test.000000000',
            'gov_doc': 'f',
            'author': 'Author, Test',
            'copyright_date': '2019',
            'rights': 'test_rights'
        }
        workTest = HathiRecord(testRow)

        workTest.buildWork = MagicMock()
        workTest.buildInstance = MagicMock()
        workTest.buildItem = MagicMock()
        workTest.createRights = MagicMock()

        workTest.buildDataModel('countryCodes')
        self.assertIsInstance(workTest, HathiRecord)