From 14cb106db27d1c96088afd3b22c0be671e54cc18 Mon Sep 17 00:00:00 2001 From: JensDiemer Date: Sat, 17 Oct 2020 19:38:06 +0200 Subject: [PATCH] add project setup test --- README.creole | 4 +- README.rst | 35 +++++++++++++++- inventory_tests/test_project_setup.py | 60 +++++++++++++++++++++++++++ pyproject.toml | 2 +- 4 files changed, 97 insertions(+), 4 deletions(-) create mode 100644 inventory_tests/test_project_setup.py diff --git a/README.creole b/README.creole index 3cffb97..fd1e37b 100644 --- a/README.creole +++ b/README.creole @@ -93,8 +93,10 @@ Nothing, yet ;) == history -* [[https://github.com/jedie/PyInventory/compare/v0.0.1...master|compare v0.0.1...master]] **dev** +* [[https://github.com/jedie/PyInventory/compare/v0.1.0...master|compare v0.1.0...master]] **dev** ** tbc +* [[https://github.com/jedie/PyInventory/compare/v0.0.1...v0.1.0|v0.1.0 - 17.10.2020]] +** Enhance models, admin and finish project setup * v0.0.1 - 14.10.2020 ** Just create a pre-alpha release to save the PyPi package name ;) diff --git a/README.rst b/README.rst index 1631840..8a6086e 100644 --- a/README.rst +++ b/README.rst @@ -101,6 +101,33 @@ tbd ~/PyInventory$ make install ... +----------- +Screenshots +----------- + +v0.0.1 +====== + +---- + +|PyInventory v0.0.1 screenshot 3.png| + +.. |PyInventory v0.0.1 screenshot 3.png| image:: https://raw.githubusercontent.com/jedie/jedie.github.io/master/screenshots/PyInventory/PyInventory v0.0.1 screenshot 3.png + +---- + +|PyInventory v0.0.1 screenshot 2.png| + +.. |PyInventory v0.0.1 screenshot 2.png| image:: https://raw.githubusercontent.com/jedie/jedie.github.io/master/screenshots/PyInventory/PyInventory v0.0.1 screenshot 2.png + +---- + +|PyInventory v0.0.1 screenshot 1.png| + +.. |PyInventory v0.0.1 screenshot 1.png| image:: https://raw.githubusercontent.com/jedie/jedie.github.io/master/screenshots/PyInventory/PyInventory v0.0.1 screenshot 1.png + +---- + ------------------------------ Backwards-incompatible changes ------------------------------ @@ -111,10 +138,14 @@ Nothing, yet ;) history ------- -* `compare v0.0.1...master `_ **dev** +* `compare v0.1.0...master `_ **dev** * tbc +* `v0.1.0 - 17.10.2020 `_ + + * Enhance models, admin and finish project setup + * v0.0.1 - 14.10.2020 * Just create a pre-alpha release to save the PyPi package name ;) @@ -144,4 +175,4 @@ donation ------------ -``Note: this file is generated from README.creole 2020-10-15 18:02:11 with "python-creole"`` \ No newline at end of file +``Note: this file is generated from README.creole 2020-10-17 19:37:03 with "python-creole"`` \ No newline at end of file diff --git a/inventory_tests/test_project_setup.py b/inventory_tests/test_project_setup.py new file mode 100644 index 0000000..bf267ff --- /dev/null +++ b/inventory_tests/test_project_setup.py @@ -0,0 +1,60 @@ +import os +import shutil +import subprocess +from pathlib import Path + +import inventory + + +PACKAGE_ROOT = Path(inventory.__file__).parent.parent + + +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(package_root=None, version=None): + if package_root is None: + package_root = PACKAGE_ROOT + + if version is None: + version = inventory.__version__ + + if 'dev' not in version and 'rc' not in version: + version_string = f'v{version}' + + assert_file_contains_string( + file_path=Path(package_root, 'README.creole'), + string=version_string + ) + + assert_file_contains_string( + file_path=Path(package_root, 'README.rst'), + string=version_string + ) + + assert_file_contains_string( + file_path=Path(package_root, 'pyproject.toml'), + string=f'version = "{version}"' + ) + + +def test_poetry_check(package_root=None): + if package_root is None: + package_root = PACKAGE_ROOT + + poerty_bin = shutil.which('poetry') + + output = subprocess.check_output( + [poerty_bin, 'check'], + universal_newlines=True, + env=os.environ, + stderr=subprocess.STDOUT, + cwd=str(package_root), + ) + print(output) + assert output == 'All set!\n' diff --git a/pyproject.toml b/pyproject.toml index 7f0c212..948d99e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "PyInventory" -version = "0.0.1" +version = "0.1.0" description = "Web based management to catalog things including state and location etc. using Python/Django." authors = ["JensDiemer "] packages = [