diff options
author | Jens Diemer <github.com@jensdiemer.de> | 2020-02-01 16:38:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-01 16:38:48 +0100 |
commit | 1d2fb1c6ac76674939e6f0c34c8623bb6d22e841 (patch) | |
tree | 1bfe84ba3ccb2c6100943e282269a82e36016990 /creole/tests/test_project_setup.py | |
parent | 69037331053950a1a03324ef3486769cc88ed591 (diff) | |
parent | 42af9043fc37dcc81767c2466139b3360d17bc7a (diff) | |
download | creole-1d2fb1c6ac76674939e6f0c34c8623bb6d22e841.tar.gz |
Merge pull request #42 from jedie/setup-utils
Setup utils
Diffstat (limited to 'creole/tests/test_project_setup.py')
-rw-r--r-- | creole/tests/test_project_setup.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/creole/tests/test_project_setup.py b/creole/tests/test_project_setup.py new file mode 100644 index 0000000..b589acf --- /dev/null +++ b/creole/tests/test_project_setup.py @@ -0,0 +1,37 @@ +""" + :copyleft: 2020 by python-creole team, see AUTHORS for more details. + :license: GNU GPL v3 or above, see LICENSE for more details. +""" + +from pathlib import Path + +from creole import __version__ +from creole.tests.constants import CREOLE_PACKAGE_ROOT + + +def assert_file_contains_string(file_path, string): + with file_path.open('r') as f: + for line in f: + if string in line: + return + raise AssertionError(f'File {file_path} does not contain {string!r} !') + + +def test_version(): + if 'dev' not in __version__: + version_string = f'v{__version__}' + + assert_file_contains_string( + file_path=Path(CREOLE_PACKAGE_ROOT, 'README.creole'), + string=version_string + ) + + assert_file_contains_string( + file_path=Path(CREOLE_PACKAGE_ROOT, 'README.rst'), + string=version_string + ) + + assert_file_contains_string( + file_path=Path(CREOLE_PACKAGE_ROOT, 'pyproject.toml'), + string=f'version = "{__version__}"' + ) |