diff options
author | Javier Sánchez Parra <jsanchez@soleta.eu> | 2019-07-05 12:40:06 +0200 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2019-07-05 17:41:26 +0200 |
commit | 1cb36eb7c3360b482e85ed4be4c9c52c1a9f4929 (patch) | |
tree | f250038beb92ca4f083ad59aeeec4b973d5e90eb | |
parent | 96cced97a86da63591e6a72ffb5a0b0785119e87 (diff) |
#915 Improve test output using unittest discover
* Call the tests with python module unittest. In particular, the
discover function.
* Rename tests files to meet the default requirements of discover
function.
-rwxr-xr-x | admin/Sources/Services/ogAdmServer/tests/run-tests.py | 3 | ||||
-rw-r--r-- | admin/Sources/Services/ogAdmServer/tests/units/test_0001_get_clients.py (renamed from admin/Sources/Services/ogAdmServer/tests/units/0001-get-clients.py) | 0 | ||||
-rw-r--r-- | admin/Sources/Services/ogAdmServer/tests/units/test_0002_post_clients.py (renamed from admin/Sources/Services/ogAdmServer/tests/units/0002-post-clients.py) | 0 | ||||
-rw-r--r-- | admin/Sources/Services/ogAdmServer/tests/units/test_0003_post_wol.py (renamed from admin/Sources/Services/ogAdmServer/tests/units/0003-post-wol.py) | 0 | ||||
-rw-r--r-- | admin/Sources/Services/ogAdmServer/tests/units/test_0004_post_shell_run.py (renamed from admin/Sources/Services/ogAdmServer/tests/units/0004-post-shell-run.py) | 0 | ||||
-rw-r--r-- | admin/Sources/Services/ogAdmServer/tests/units/test_0005_post_shell_output.py (renamed from admin/Sources/Services/ogAdmServer/tests/units/0005-post-shell-output.py) | 0 | ||||
-rw-r--r-- | admin/Sources/Services/ogAdmServer/tests/units/test_0006_post_session.py (renamed from admin/Sources/Services/ogAdmServer/tests/units/0006-post-session.py) | 0 |
7 files changed, 1 insertions, 2 deletions
diff --git a/admin/Sources/Services/ogAdmServer/tests/run-tests.py b/admin/Sources/Services/ogAdmServer/tests/run-tests.py index f0ddb875..126105d1 100755 --- a/admin/Sources/Services/ogAdmServer/tests/run-tests.py +++ b/admin/Sources/Services/ogAdmServer/tests/run-tests.py @@ -30,8 +30,7 @@ start_mysql(); subprocess.Popen(['../ogAdmServer', '-f', 'config/ogAdmServer.cfg']) -for filename in glob.iglob('units/**'): - subprocess.run(['python3', filename, '-v']) +subprocess.run('python3 -m unittest discover -s units -v', shell=True) stop_mysql(); diff --git a/admin/Sources/Services/ogAdmServer/tests/units/0001-get-clients.py b/admin/Sources/Services/ogAdmServer/tests/units/test_0001_get_clients.py index 55712250..55712250 100644 --- a/admin/Sources/Services/ogAdmServer/tests/units/0001-get-clients.py +++ b/admin/Sources/Services/ogAdmServer/tests/units/test_0001_get_clients.py diff --git a/admin/Sources/Services/ogAdmServer/tests/units/0002-post-clients.py b/admin/Sources/Services/ogAdmServer/tests/units/test_0002_post_clients.py index b1e60c91..b1e60c91 100644 --- a/admin/Sources/Services/ogAdmServer/tests/units/0002-post-clients.py +++ b/admin/Sources/Services/ogAdmServer/tests/units/test_0002_post_clients.py diff --git a/admin/Sources/Services/ogAdmServer/tests/units/0003-post-wol.py b/admin/Sources/Services/ogAdmServer/tests/units/test_0003_post_wol.py index cbb2fd17..cbb2fd17 100644 --- a/admin/Sources/Services/ogAdmServer/tests/units/0003-post-wol.py +++ b/admin/Sources/Services/ogAdmServer/tests/units/test_0003_post_wol.py diff --git a/admin/Sources/Services/ogAdmServer/tests/units/0004-post-shell-run.py b/admin/Sources/Services/ogAdmServer/tests/units/test_0004_post_shell_run.py index 7be1fa96..7be1fa96 100644 --- a/admin/Sources/Services/ogAdmServer/tests/units/0004-post-shell-run.py +++ b/admin/Sources/Services/ogAdmServer/tests/units/test_0004_post_shell_run.py diff --git a/admin/Sources/Services/ogAdmServer/tests/units/0005-post-shell-output.py b/admin/Sources/Services/ogAdmServer/tests/units/test_0005_post_shell_output.py index 622e482d..622e482d 100644 --- a/admin/Sources/Services/ogAdmServer/tests/units/0005-post-shell-output.py +++ b/admin/Sources/Services/ogAdmServer/tests/units/test_0005_post_shell_output.py diff --git a/admin/Sources/Services/ogAdmServer/tests/units/0006-post-session.py b/admin/Sources/Services/ogAdmServer/tests/units/test_0006_post_session.py index d2351796..d2351796 100644 --- a/admin/Sources/Services/ogAdmServer/tests/units/0006-post-session.py +++ b/admin/Sources/Services/ogAdmServer/tests/units/test_0006_post_session.py |