add project setup test

pull/5/head
JensDiemer 2020-10-17 19:38:06 +02:00
rodzic ccba5c09e4
commit 14cb106db2
4 zmienionych plików z 97 dodań i 4 usunięć

Wyświetl plik

@ -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 ;)

Wyświetl plik

@ -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 <https://github.com/jedie/PyInventory/compare/v0.0.1...master>`_ **dev**
* `compare v0.1.0...master <https://github.com/jedie/PyInventory/compare/v0.1.0...master>`_ **dev**
* tbc
* `v0.1.0 - 17.10.2020 <https://github.com/jedie/PyInventory/compare/v0.0.1...v0.1.0>`_
* 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"``
``Note: this file is generated from README.creole 2020-10-17 19:37:03 with "python-creole"``

Wyświetl plik

@ -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'

Wyświetl plik

@ -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 <git@jensdiemer.de>"]
packages = [