Ejemplo n.º 1
0
 def test_licence_url_multiple_urls(self):
     # only the first URL is extracted
     assert_equal(GeminiHarvester._extract_first_licence_url(
         ['Reference and PSMA Only',
          'http://www.test.gov.uk/licenseurl',
          'http://www.test.gov.uk/2nd_licenseurl']),
                  'http://www.test.gov.uk/licenseurl')
Ejemplo n.º 2
0
 def test_licence_url_multiple_urls(self):
     # only the first URL is extracted
     assert_equal(GeminiHarvester._extract_first_licence_url(
         ['Reference and PSMA Only',
          'http://www.test.gov.uk/licenseurl',
          'http://www.test.gov.uk/2nd_licenseurl']),
                  'http://www.test.gov.uk/licenseurl')
Ejemplo n.º 3
0
 def test_licence_url_embedded_at_start(self):
     # URL is embedded at the start of the text field and the
     # whole field is returned. Noting this unusual behaviour
     assert_equal(
         GeminiHarvester._extract_first_licence_url(
             ['http://www.test.gov.uk/licenseurl Reference and PSMA Only']),
         'http://www.test.gov.uk/licenseurl Reference and PSMA Only')
Ejemplo n.º 4
0
 def test_licence_url_embedded(self):
     ''' '''
     # URL is embedded within the text field and not extracted
     assert_equal(
         GeminiHarvester._extract_first_licence_url([
             u'Reference and PSMA Only http://www.test.gov.uk/licenseurl'
         ]), None)
Ejemplo n.º 5
0
 def test_licence_url_normal(self):
     ''' '''
     assert_equal(
         GeminiHarvester._extract_first_licence_url([
             u'Reference and PSMA Only',
             u'http://www.test.gov.uk/licenseurl'
         ]), u'http://www.test.gov.uk/licenseurl')
Ejemplo n.º 6
0
 def test_licence_url_embedded_at_start(self):
     # URL is embedded at the start of the text field and the
     # whole field is returned. Noting this unusual behaviour
     assert_equal(GeminiHarvester._extract_first_licence_url(
         ['http://www.test.gov.uk/licenseurl Reference and PSMA Only']),
                  'http://www.test.gov.uk/licenseurl Reference and PSMA Only')
Ejemplo n.º 7
0
 def test_licence_url_embedded(self):
     # URL is embedded within the text field and not extracted
     assert_equal(GeminiHarvester._extract_first_licence_url(
         ['Reference and PSMA Only http://www.test.gov.uk/licenseurl']),
                  None)
Ejemplo n.º 8
0
 def test_licence_url_normal(self):
     assert_equal(GeminiHarvester._extract_first_licence_url(
         ['Reference and PSMA Only',
          'http://www.test.gov.uk/licenseurl']),
                  'http://www.test.gov.uk/licenseurl')