mirror of
https://github.com/YunoHost-Apps/django-for-runners_ynh.git
synced 2024-09-03 18:26:16 +02:00
Add screenshots
This commit is contained in:
parent
d8588a83b1
commit
f0b3fbbb6d
4 changed files with 30 additions and 7 deletions
BIN
doc/screenshots/for_runers_v060_2018_07_31_gpx_track.png
Normal file
BIN
doc/screenshots/for_runers_v060_2018_07_31_gpx_track.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1 MiB |
BIN
doc/screenshots/for_runners_v040_2018_6_26_gpx_info.png
Normal file
BIN
doc/screenshots/for_runners_v040_2018_6_26_gpx_info.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 187 KiB |
BIN
doc/screenshots/for_runners_v060_2018_07_19_event_costs.png
Normal file
BIN
doc/screenshots/for_runners_v060_2018_07_19_event_costs.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 19 KiB |
|
@ -4,9 +4,9 @@ import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from bx_py_utils.path import assert_is_file
|
|
||||||
|
|
||||||
import for_runners
|
import for_runners
|
||||||
|
from bx_django_utils.filename import clean_filename
|
||||||
|
from bx_py_utils.path import assert_is_dir, assert_is_file
|
||||||
|
|
||||||
|
|
||||||
PACKAGE_ROOT = Path(__file__).parent.parent
|
PACKAGE_ROOT = Path(__file__).parent.parent
|
||||||
|
@ -23,8 +23,12 @@ def assert_file_contains_string(file_path, string):
|
||||||
def test_version():
|
def test_version():
|
||||||
version = for_runners.__version__
|
version = for_runners.__version__
|
||||||
|
|
||||||
assert_file_contains_string(file_path=Path(PACKAGE_ROOT, 'pyproject.toml'), string=f'version = "{version}~ynh')
|
assert_file_contains_string(
|
||||||
assert_file_contains_string(file_path=Path(PACKAGE_ROOT, 'manifest.json'), string=f'"version": "{version}~ynh')
|
file_path=Path(PACKAGE_ROOT, 'pyproject.toml'), string=f'version = "{version}~ynh'
|
||||||
|
)
|
||||||
|
assert_file_contains_string(
|
||||||
|
file_path=Path(PACKAGE_ROOT, 'manifest.json'), string=f'"version": "{version}~ynh'
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def poetry_check_output(*args):
|
def poetry_check_output(*args):
|
||||||
|
@ -32,7 +36,7 @@ def poetry_check_output(*args):
|
||||||
|
|
||||||
output = subprocess.check_output(
|
output = subprocess.check_output(
|
||||||
(poerty_bin,) + args,
|
(poerty_bin,) + args,
|
||||||
universal_newlines=True,
|
text=True,
|
||||||
env=os.environ,
|
env=os.environ,
|
||||||
stderr=subprocess.STDOUT,
|
stderr=subprocess.STDOUT,
|
||||||
cwd=str(PACKAGE_ROOT),
|
cwd=str(PACKAGE_ROOT),
|
||||||
|
@ -57,9 +61,28 @@ def test_requirements_txt():
|
||||||
|
|
||||||
diff = '\n'.join(
|
diff = '\n'.join(
|
||||||
difflib.unified_diff(
|
difflib.unified_diff(
|
||||||
current_content.splitlines(), output.splitlines(),
|
current_content.splitlines(),
|
||||||
fromfile=str(requirements_txt), tofile='FRESH EXPORT'
|
output.splitlines(),
|
||||||
|
fromfile=str(requirements_txt),
|
||||||
|
tofile='FRESH EXPORT',
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
print(diff)
|
print(diff)
|
||||||
assert diff == '', f'{requirements_txt} is not up-to-date! (Hint: call: "make update")'
|
assert diff == '', f'{requirements_txt} is not up-to-date! (Hint: call: "make update")'
|
||||||
|
|
||||||
|
|
||||||
|
def test_screenshot_filenames():
|
||||||
|
"""
|
||||||
|
https://forum.yunohost.org/t/yunohost-bot-cant-handle-spaces-in-screenshots/19483
|
||||||
|
"""
|
||||||
|
screenshot_path = PACKAGE_ROOT / 'doc' / 'screenshots'
|
||||||
|
assert_is_dir(screenshot_path)
|
||||||
|
renamed = []
|
||||||
|
for file_path in screenshot_path.iterdir():
|
||||||
|
file_name = file_path.name
|
||||||
|
cleaned_name = clean_filename(file_name)
|
||||||
|
if cleaned_name != file_name:
|
||||||
|
new_path = file_path.with_name(cleaned_name)
|
||||||
|
file_path.rename(new_path)
|
||||||
|
renamed.append(f'{file_name!r} renamed to {cleaned_name!r}')
|
||||||
|
assert not renamed, f'Bad screenshots file names found: {", ".join(renamed)}'
|
||||||
|
|
Loading…
Reference in a new issue