Ejemplo n.º 1
0
 def test_responsible_organisation_blank(self):
     ''' '''
     # no owner or publisher, so blank provider
     responsible_organisation = []
     assert_equal(
         GeminiHarvester._process_responsible_organisation(
             responsible_organisation), (u'', []))
Ejemplo n.º 2
0
 def test_responsible_organisation_basic(self):
     responsible_organisation = [{'organisation-name': 'Ordnance Survey',
                                  'role': 'owner'},
                                 {'organisation-name': 'Maps Ltd',
                                  'role': 'distributor'}]
     assert_equal(GeminiHarvester._process_responsible_organisation(responsible_organisation),
                  ('Ordnance Survey', ['Maps Ltd (distributor)',
                                       'Ordnance Survey (owner)']))
Ejemplo n.º 3
0
 def test_responsible_organisation_basic(self):
     responsible_organisation = [{'organisation-name': 'Ordnance Survey',
                                  'role': 'owner'},
                                 {'organisation-name': 'Maps Ltd',
                                  'role': 'distributor'}]
     assert_equal(GeminiHarvester._process_responsible_organisation(responsible_organisation),
                  ('Ordnance Survey', ['Maps Ltd (distributor)',
                                       'Ordnance Survey (owner)']))
Ejemplo n.º 4
0
 def test_responsible_organisation_publisher(self):
     # no owner, so falls back to publisher
     responsible_organisation = [{'organisation-name': 'Ordnance Survey',
                                  'role': 'publisher'},
                                 {'organisation-name': 'Maps Ltd',
                                  'role': 'distributor'}]
     assert_equal(GeminiHarvester._process_responsible_organisation(responsible_organisation),
                  ('Ordnance Survey', ['Maps Ltd (distributor)',
                                       'Ordnance Survey (publisher)']))
Ejemplo n.º 5
0
 def test_responsible_organisation_blank_provider(self):
     # no owner or publisher, so blank provider
     responsible_organisation = [{'organisation-name': 'Ordnance Survey',
                                  'role': 'resourceProvider'},
                                 {'organisation-name': 'Maps Ltd',
                                  'role': 'distributor'}]
     assert_equal(GeminiHarvester._process_responsible_organisation(responsible_organisation),
                  ('', ['Maps Ltd (distributor)',
                        'Ordnance Survey (resourceProvider)']))
Ejemplo n.º 6
0
 def test_responsible_organisation_blank_provider(self):
     # no owner or publisher, so blank provider
     responsible_organisation = [{'organisation-name': 'Ordnance Survey',
                                  'role': 'resourceProvider'},
                                 {'organisation-name': 'Maps Ltd',
                                  'role': 'distributor'}]
     assert_equal(GeminiHarvester._process_responsible_organisation(responsible_organisation),
                  ('', ['Maps Ltd (distributor)',
                        'Ordnance Survey (resourceProvider)']))
Ejemplo n.º 7
0
 def test_responsible_organisation_publisher(self):
     # no owner, so falls back to publisher
     responsible_organisation = [{'organisation-name': 'Ordnance Survey',
                                  'role': 'publisher'},
                                 {'organisation-name': 'Maps Ltd',
                                  'role': 'distributor'}]
     assert_equal(GeminiHarvester._process_responsible_organisation(responsible_organisation),
                  ('Ordnance Survey', ['Maps Ltd (distributor)',
                                       'Ordnance Survey (publisher)']))
Ejemplo n.º 8
0
 def test_responsible_organisation_multiple_roles(self):
     # provider is the owner (ignores publisher)
     responsible_organisation = [{'organisation-name': 'Ordnance Survey',
                                  'role': 'publisher'},
                                 {'organisation-name': 'Ordnance Survey',
                                  'role': 'custodian'},
                                 {'organisation-name': 'Distributor',
                                  'role': 'distributor'}]
     assert_equal(GeminiHarvester._process_responsible_organisation(responsible_organisation),
                  ('Ordnance Survey', ['Distributor (distributor)',
                                       'Ordnance Survey (publisher, custodian)',
                             ]))
Ejemplo n.º 9
0
 def test_responsible_organisation_multiple_roles(self):
     # provider is the owner (ignores publisher)
     responsible_organisation = [{'organisation-name': 'Ordnance Survey',
                                  'role': 'publisher'},
                                 {'organisation-name': 'Ordnance Survey',
                                  'role': 'custodian'},
                                 {'organisation-name': 'Distributor',
                                  'role': 'distributor'}]
     assert_equal(GeminiHarvester._process_responsible_organisation(responsible_organisation),
                  ('Ordnance Survey', ['Distributor (distributor)',
                                       'Ordnance Survey (publisher, custodian)',
                             ]))
Ejemplo n.º 10
0
 def test_responsible_organisation_owner(self):
     # provider is the owner (ignores publisher)
     responsible_organisation = [{'organisation-name': 'Ordnance Survey',
                                  'role': 'publisher'},
                                 {'organisation-name': 'Owner',
                                  'role': 'owner'},
                                 {'organisation-name': 'Maps Ltd',
                                  'role': 'distributor'}]
     assert_equal(GeminiHarvester._process_responsible_organisation(responsible_organisation),
                  ('Owner', ['Owner (owner)',
                             'Maps Ltd (distributor)',
                             'Ordnance Survey (publisher)',
                             ]))
Ejemplo n.º 11
0
 def test_responsible_organisation_owner(self):
     # provider is the owner (ignores publisher)
     responsible_organisation = [{'organisation-name': 'Ordnance Survey',
                                  'role': 'publisher'},
                                 {'organisation-name': 'Owner',
                                  'role': 'owner'},
                                 {'organisation-name': 'Maps Ltd',
                                  'role': 'distributor'}]
     assert_equal(GeminiHarvester._process_responsible_organisation(responsible_organisation),
                  ('Owner', ['Owner (owner)',
                             'Maps Ltd (distributor)',
                             'Ordnance Survey (publisher)',
                             ]))
Ejemplo n.º 12
0
 def test_responsible_organisation_blank(self):
     # no owner or publisher, so blank provider
     responsible_organisation = []
     assert_equal(GeminiHarvester._process_responsible_organisation(responsible_organisation),
                  ('', []))