From 6d0f07ec6ead1d33294708681c63db53e3ac5800 Mon Sep 17 00:00:00 2001 From: Jens Diemer Date: Sun, 4 Aug 2024 21:06:06 +0200 Subject: [PATCH] Add a "manage_local_test.py" and tests --- manage_local_test.py | 11 +++++++++++ tests/test_manage_local_test.py | 17 +++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100755 manage_local_test.py create mode 100644 tests/test_manage_local_test.py diff --git a/manage_local_test.py b/manage_local_test.py new file mode 100755 index 0000000..f576b5b --- /dev/null +++ b/manage_local_test.py @@ -0,0 +1,11 @@ +#!.venv/bin/python3 + +""" + Call the "manage.py" from the local test environment. +""" + +from django_yunohost_integration.local_test import run_local_test_manage + + +if __name__ == '__main__': + run_local_test_manage() diff --git a/tests/test_manage_local_test.py b/tests/test_manage_local_test.py new file mode 100644 index 0000000..17d5cd6 --- /dev/null +++ b/tests/test_manage_local_test.py @@ -0,0 +1,17 @@ +import subprocess +from unittest import TestCase + +from bx_py_utils.path import assert_is_file + +from django_yunohost_integration.path_utils import get_project_root + + +class ManageLocalTestTestCase(TestCase): + def test_manage_local_test_check(self): + + manage_local_test_bin = get_project_root() / 'manage_local_test.py' + assert_is_file(manage_local_test_bin) + + output = subprocess.check_output([manage_local_test_bin, 'check'], text=True) + self.assertIn('Setup local YunoHost package', output) + self.assertIn('django-for-runners_ynh/local_test/', output)