File: test_license.py

package info (click to toggle)
python-keycloak 5.7.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,372 kB
  • sloc: python: 14,249; sh: 43; makefile: 28
file content (16 lines) | stat: -rw-r--r-- 524 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"""Tests for license."""

import os
import pathlib


def test_license_present() -> None:
    """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 pathlib.Path(pathlib.Path(path) / _file).open("r") as fp:
                    content = fp.read()
                assert content.startswith(
                    "#\n# The MIT License (MIT)\n#\n#",
                )