Example #1
0
 def test_ogl_url_with_trailing_semicolon(self):
     assert_equal(
         detect_license_id(
             'Some licence (http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/; More terms'
         ), ('uk-ogl', False))
Example #2
0
 def test_ogl_mispelt(self):
     assert_equal(detect_license_id('Open Government License'),
                  ('uk-ogl', True))
Example #3
0
 def test_ogl_abbreviation_in_parens(self):
     assert_equal(detect_license_id('Some licence (OGL)'),
                  ('uk-ogl', False))
Example #4
0
 def test_ogl_variations_are_wholy_ogl_17(self):
     assert_equal(
         detect_license_id(
             'Public data (Crown Copyright) - Open Government Licence Terms and Conditions apply'
         ), ('uk-ogl', True))
Example #5
0
 def test_not_ogl(self):
     assert_equal(
         detect_license_id(
             'Data is freely available for research or commercial use providing that the originators are acknowledged in any publications produced.'
         ), ('', None))
Example #6
0
 def test_ogl_variations_are_wholy_ogl_6(self):
     assert_equal(
         detect_license_id(
             'Use of data subject to the Terms and Conditions of the OGL (Open Government Licence): data is free to use for provided the source is acknowledged as specified in said document.'
         ), ('uk-ogl', True))
Example #7
0
 def test_ogl_variations_are_wholy_ogl_12(self):
     assert_equal(detect_license_id('Open Government Licence; None'),
                  ('uk-ogl', True))
Example #8
0
 def test_ogl_url_with_trailing_semicolon(self):
     assert_equal(detect_license_id('Some licence (http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/; More terms'),
                  ('uk-ogl', False))
Example #9
0
 def test_ogl_and_require_citation(self):
     assert_equal(detect_license_id('Use of data subject to the Terms and Conditions of the OGL (Open Government Licence) and you must cite "Natural England" as the source.'),
                  ('uk-ogl', False))
Example #10
0
 def test_ogl_abbreviation_in_parens(self):
     assert_equal(detect_license_id('Some licence (OGL)'),
                  ('uk-ogl', False))
Example #11
0
 def test_ogl_url_in_parens(self):
     assert_equal(detect_license_id('Some licence (http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/)'),
                  ('uk-ogl', False))
Example #12
0
 def test_ogl_abbreviation(self):
     assert_equal(detect_license_id('OGL Licence'),
                  ('uk-ogl', True))
Example #13
0
 def test_ogl_mispelt(self):
     assert_equal(detect_license_id('Open Government License'),
                  ('uk-ogl', True))
Example #14
0
 def test_not_ogl2(self):
     assert_equal(detect_license_id('bogl'),
                  ('', None))
Example #15
0
 def test_ogl_and_require_citation2(self):
     assert_equal(
         detect_license_id(
             'Released under the Open Government Licence (OGL), citation of "Natural England" as the source required.'
         ), ('uk-ogl', False))
Example #16
0
 def test_ogl_and_require_citation2(self):
     assert_equal(detect_license_id('Released under the Open Government Licence (OGL), citation of "Natural England" as the source required.'),
                  ('uk-ogl', False))
Example #17
0
 def test_ogl_url(self):
     assert_equal(
         detect_license_id(
             'http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/'
         ), ('uk-ogl', True))
Example #18
0
 def test_ogl_with_other_url(self):
     assert_equal(detect_license_id('By using this data you are accepting the terms of the Natural England-OS Open Government Licence (https://www.gov.uk/government/uploads/system/uploads/attachment_data/file/391764/OGL-NE-OS.pdf). For further info contact Natural England (UK +44) 0 845 600 3900 [email protected] <https://www.gov.uk/government/uploads/system/uploads/attachment_data/file/391764/OGL-NE-OS.pdf>'),
                  ('uk-ogl', False))
Example #19
0
 def test_ogl_variations_are_wholy_ogl_8(self):
     assert_equal(
         detect_license_id(
             'Link to the Open Government Licence; Licence; http://www.nationalarchives.gov.uk/doc/open-government-licence/'
         ), ('uk-ogl', True))
Example #20
0
 def test_ogl_url(self):
     assert_equal(detect_license_id('http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/'),
                  ('uk-ogl', True))
Example #21
0
 def test_ogl_variations_are_wholy_ogl_15(self):
     assert_equal(
         detect_license_id(
             'In accessing or using this data, you are deemed to have accepted the terms of the UK Open Government Licence v3.0. - http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/'
         ), ('uk-ogl', True))
Example #22
0
 def test_ogl_variations_are_wholy_ogl_2(self):
     assert_equal(detect_license_id('Open government license for public sector information.; http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/'),
                  ('uk-ogl', True))
Example #23
0
 def test_not_ogl(self):
     assert_equal(detect_license_id('Data is freely available for research or commercial use providing that the originators are acknowledged in any publications produced.'),
                  ('', None))
Example #24
0
 def test_ogl_variations_are_wholy_ogl_6(self):
     assert_equal(detect_license_id('Use of data subject to the Terms and Conditions of the OGL (Open Government Licence): data is free to use for provided the source is acknowledged as specified in said document.'),
                  ('uk-ogl', True))
Example #25
0
 def test_not_ogl2(self):
     assert_equal(detect_license_id('bogl'), ('', None))
Example #26
0
 def test_ogl_variations_are_wholy_ogl_7(self):
     assert_equal(detect_license_id('Released under the Open Government Licence (OGL), citation of publisher and online resource required on reuse.'),
                  ('uk-ogl', True))
Example #27
0
 def test_ogl_abbreviation(self):
     assert_equal(detect_license_id('OGL Licence'), ('uk-ogl', True))
Example #28
0
 def test_ogl_variations_are_wholy_ogl_8(self):
     assert_equal(detect_license_id('Link to the Open Government Licence; Licence; http://www.nationalarchives.gov.uk/doc/open-government-licence/'),
                  ('uk-ogl', True))
Example #29
0
 def test_ogl_url_in_parens(self):
     assert_equal(
         detect_license_id(
             'Some licence (http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/)'
         ), ('uk-ogl', False))
Example #30
0
 def test_ogl_variations_are_wholy_ogl_10(self):
     assert_equal(detect_license_id('Link to the Open Government Licence; Link to the Ordnance Survey Open Data Licence; Licence; http://www.ordnancesurvey.co.uk/oswebsite/docs/licences/os-opendata-licence.pdf; http://www.nationalarchives.gov.uk/doc/open-government-licence/'),
                  ('uk-ogl', True))
Example #31
0
 def test_ogl_and_require_citation(self):
     assert_equal(
         detect_license_id(
             'Use of data subject to the Terms and Conditions of the OGL (Open Government Licence) and you must cite "Natural England" as the source.'
         ), ('uk-ogl', False))
Example #32
0
 def test_ogl_variations_are_wholy_ogl_12(self):
     assert_equal(detect_license_id('Open Government Licence; None'),
                  ('uk-ogl', True))
Example #33
0
 def test_ogl_with_other_url(self):
     assert_equal(
         detect_license_id(
             'By using this data you are accepting the terms of the Natural England-OS Open Government Licence (https://www.gov.uk/government/uploads/system/uploads/attachment_data/file/391764/OGL-NE-OS.pdf). For further info contact Natural England (UK +44) 0 845 600 3900 [email protected] <https://www.gov.uk/government/uploads/system/uploads/attachment_data/file/391764/OGL-NE-OS.pdf>'
         ), ('uk-ogl', False))
Example #34
0
 def test_ogl_variations_are_wholy_ogl_14(self):
     assert_equal(detect_license_id('Open Government Licences and agreements explained; http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/;'),
                  ('uk-ogl', True))
Example #35
0
 def test_ogl_variations_are_wholy_ogl_2(self):
     assert_equal(
         detect_license_id(
             'Open government license for public sector information.; http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/'
         ), ('uk-ogl', True))
Example #36
0
 def test_ogl_variations_are_wholy_ogl_15(self):
     assert_equal(detect_license_id('In accessing or using this data, you are deemed to have accepted the terms of the UK Open Government Licence v3.0. - http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/'),
                  ('uk-ogl', True))
Example #37
0
 def test_ogl_variations_are_wholy_ogl_7(self):
     assert_equal(
         detect_license_id(
             'Released under the Open Government Licence (OGL), citation of publisher and online resource required on reuse.'
         ), ('uk-ogl', True))
Example #38
0
 def test_ogl_variations_are_wholy_ogl_16(self):
     assert_equal(detect_license_id('Open Government Licence: attribution required; http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/'),
                  ('uk-ogl', True))
Example #39
0
 def test_ogl_variations_are_wholy_ogl_10(self):
     assert_equal(
         detect_license_id(
             'Link to the Open Government Licence; Link to the Ordnance Survey Open Data Licence; Licence; http://www.ordnancesurvey.co.uk/oswebsite/docs/licences/os-opendata-licence.pdf; http://www.nationalarchives.gov.uk/doc/open-government-licence/'
         ), ('uk-ogl', True))
Example #40
0
 def test_ogl_variations_are_wholy_ogl_17(self):
     assert_equal(detect_license_id('Public data (Crown Copyright) - Open Government Licence Terms and Conditions apply'),
                  ('uk-ogl', True))
Example #41
0
 def test_ogl_variations_are_wholy_ogl_14(self):
     assert_equal(
         detect_license_id(
             'Open Government Licences and agreements explained; http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/;'
         ), ('uk-ogl', True))
Example #42
0
 def test_ne(self):
     # should not really say it is OGL, but the slash and dash are seen as word boundaries
     assert_equal(detect_license_id('https://www.gov.uk/government/uploads/system/uploads/attachment_data/file/391764/OGL-NE-OS.pdf'),
                  ('uk-ogl', False))
Example #43
0
 def test_ogl_variations_are_wholy_ogl_16(self):
     assert_equal(
         detect_license_id(
             'Open Government Licence: attribution required; http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/'
         ), ('uk-ogl', True))
Example #44
0
 def test_blank(self):
     assert_equal(detect_license_id(''), ('', None))
Example #45
0
 def test_ne(self):
     # should not really say it is OGL, but the slash and dash are seen as word boundaries
     assert_equal(
         detect_license_id(
             'https://www.gov.uk/government/uploads/system/uploads/attachment_data/file/391764/OGL-NE-OS.pdf'
         ), ('uk-ogl', False))
Example #46
0
 def test_blank(self):
     assert_equal(detect_license_id(''), ('', None))