Esempio 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'', []))
Esempio 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)']))
Esempio 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)']))
Esempio 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)']))
Esempio 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)']))
Esempio 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)']))
Esempio 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)']))
Esempio 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)',
                             ]))
Esempio 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)',
                             ]))
Esempio 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)',
                             ]))
Esempio 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)',
                             ]))
Esempio 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),
                  ('', []))