From 17bfad5ec0b8a6bad887c3964df3d427f8378b47 Mon Sep 17 00:00:00 2001 From: Richard Nemeth Date: Sun, 3 Jul 2022 20:01:00 +0000 Subject: [PATCH] test: added a license test --- tests/test_license.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/test_license.py diff --git a/tests/test_license.py b/tests/test_license.py new file mode 100644 index 0000000..3c6b10e --- /dev/null +++ b/tests/test_license.py @@ -0,0 +1,14 @@ +"""Tests for license.""" +import os + + +def test_license_present(): + """Test that the MIT license is present in the header of each module file.""" + for path, _, files in os.walk("src/keycloak"): + for _file in files: + if _file.endswith(".py"): + with open(os.path.join(path, _file), "r") as fp: + content = fp.read() + assert content.startswith( + "# -*- coding: utf-8 -*-\n#\n# The MIT License (MIT)\n#\n#" + )