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")))
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"))
def test_empty(self): """empty files like __init__ are skipped""" errors = check_license(self.empty) assert_that(errors, has_length(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))
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))
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"))
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))
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"))
def test_no_copyright(self): """copyright is missing""" errors = check_license(self.valid) assert_that(errors, has_item("25: L101 copyright is missing"))
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"))
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"))
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"))