コード例 #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))