You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
524 B

12 months ago
  1. """Tests for license."""
  2. import os
  3. import pathlib
  4. def test_license_present() -> None:
  5. """Test that the MIT license is present in the header of each module file."""
  6. for path, _, files in os.walk("src/keycloak"):
  7. for _file in files:
  8. if _file.endswith(".py"):
  9. with pathlib.Path(pathlib.Path(path) / _file).open("r") as fp:
  10. content = fp.read()
  11. assert content.startswith(
  12. "#\n# The MIT License (MIT)\n#\n#",
  13. )