예제 #1
0
def test_map_extent():
    """MissouriMapper gets extent from physicalDescription"""
    # Normal case
    provider_data = {
        'physicalDescription': {
            'extent': '285 pages',
            'xmlns:default': 'http://www.loc.gov/mods/v3'
        }
    }
    mm = MissouriMapper(provider_data)
    mm.map_extent()
    assert_equals({'sourceResource': {'extent': '285 pages'}}, mm.mapped_data)
    # physicalDescription could have no 'extent' property.  Real example:
    # "physicalDescription": {
    #     "xmlns:default": "http://www.loc.gov/mods/v3"
    # }
    provider_data = {
        'physicalDescription': {
            'xmlns:default': 'http://www.loc.gov/mods/v3'
        }
    }
    mm = MissouriMapper(provider_data)
    mm.map_extent()
    assert_equals({'sourceResource': {}}, mm.mapped_data)
예제 #2
0
def test_map_extent():
    """MissouriMapper gets extent from physicalDescription"""
    # Normal case
    provider_data = {
        'physicalDescription': {
            'extent': '285 pages',
            'xmlns:default': 'http://www.loc.gov/mods/v3'
        }
    }
    mm = MissouriMapper(provider_data)
    mm.map_extent()
    assert_equals({'sourceResource': {'extent': '285 pages'}}, mm.mapped_data)
    # physicalDescription could have no 'extent' property.  Real example:
    # "physicalDescription": {
    #     "xmlns:default": "http://www.loc.gov/mods/v3"
    # }
    provider_data = {
        'physicalDescription': {
            'xmlns:default': 'http://www.loc.gov/mods/v3'
        }
    }
    mm = MissouriMapper(provider_data)
    mm.map_extent()
    assert_equals({'sourceResource': {}}, mm.mapped_data)