Пример #1
0
    def test_unicode_license(self):
        """invalid_license uses unicode copyright and multiline years.

        Where copyright is ©.
        """
        errors = check_license(self.invalid_license, year=2014)
        assert_that(errors, is_not(has_item("25: L101 copyright is missing")))
Пример #2
0
 def test_outdated_license(self):
     """valid_license has an outdated license."""
     errors = check_license(self.valid_license, year=2015)
     assert_that(
         errors,
         has_item("5: L102 copyright year is outdated, "
                  "expected 2015 but got 2014"))
Пример #3
0
    def test_unicode_license(self):
        """invalid_license uses unicode copyright and multiline years.

        Where copyright is ©.
        """
        errors = check_license(self.invalid_license, year=2014)
        assert_that(errors, is_not(has_item("25: L101 copyright is missing")))
Пример #4
0
 def test_empty(self):
     """empty files like __init__ are skipped"""
     errors = check_license(self.empty)
     assert_that(errors, has_length(0))
Пример #5
0
 def test_license_css(self):
     """license.css has a well formatted license."""
     errors = check_license(self.license_css, year=2014, python_style=False)
     assert_that(errors, has_length(0))
Пример #6
0
 def test_license_jinja(self):
     """license.html has a well formatted license."""
     errors = check_license(self.license_html, year=2014)
     assert_that(errors, has_length(0))
Пример #7
0
 def test_missing(self):
     """missing_license has only the copyright"""
     errors = check_license(self.missing_license, year=2015)
     assert_that(errors, has_item("13: L100 license is missing"))
Пример #8
0
 def test_license(self):
     """valid_license has a well formatted license."""
     errors = check_license(self.valid_license, year=2014)
     assert_that(errors, has_length(0))
Пример #9
0
 def test_doesnt_look_like_gnu_gpl(self):
     """invalid_license doesn't look like the GNU GPL"""
     errors = check_license(self.invalid_license, year=2014)
     assert_that(errors, has_item("25: L103 license is not GNU GPLv2"))
Пример #10
0
 def test_doesnt_look_like_gnu_gpl(self):
     """invalid_license doesn't look like the GNU GPL"""
     errors = check_license(self.invalid_license, year=2014)
     assert_that(errors, has_item("25: L103 license is not GNU GPLv2"))
Пример #11
0
 def test_no_copyright(self):
     """copyright is missing"""
     errors = check_license(self.valid)
     assert_that(errors, has_item("25: L101 copyright is missing"))
Пример #12
0
 def test_empty(self):
     """empty files like __init__ are skipped"""
     errors = check_license(self.empty)
     assert_that(errors, has_length(0))
Пример #13
0
 def test_license_css(self):
     """license.css has a well formatted license."""
     errors = check_license(self.license_css, year=2014, python_style=False)
     assert_that(errors, has_length(0))
Пример #14
0
 def test_license_jinja(self):
     """license.html has a well formatted license."""
     errors = check_license(self.license_html, year=2014)
     assert_that(errors, has_length(0))
Пример #15
0
 def test_missing(self):
     """missing_license has only the copyright"""
     errors = check_license(self.missing_license)
     assert_that(errors, has_item("13: L100 license is missing"))
Пример #16
0
 def test_no_copyright(self):
     """copyright is missing"""
     errors = check_license(self.valid)
     assert_that(errors, has_item("25: L101 copyright is missing"))
Пример #17
0
 def test_outdated_license(self):
     """valid_license has an outdated license."""
     errors = check_license(self.valid_license, year=2015)
     assert_that(errors, has_item("5: L102 copyright year is outdated, "
                                  "expected 2015 but got 2014"))
Пример #18
0
 def test_badly_encoded_file(self):
     errors = check_license(self.cp1252, year=2014)
     assert_that(errors,
                 has_item("24: L190 file cannot be decoded as utf-8"))
Пример #19
0
 def test_badly_encoded_file(self):
     errors = check_license(self.cp1252, year=2014)
     assert_that(errors,
                 has_item("24: L190 file cannot be decoded as utf-8"))
Пример #20
0
 def test_license(self):
     """valid_license has a well formatted license."""
     errors = check_license(self.valid_license, year=2014)
     assert_that(errors, has_length(0))