Commit 77f1c5462346595a6964f48b71cb1ae10e1eec49
1 parent
dbefae59
Exists in
dev
Ajouté options "test" et "testall" dans pyros.py
(pour exécution des anciens tests unitaires) => pyros.py test => pyros.py testall
Showing
3 changed files
with
27 additions
and
3 deletions
Show diff stats
devices_channel/README.md
1 | 1 | |
2 | -VERSION: 0.30.1 | |
2 | +VERSION: 0.30.2 | |
3 | 3 | |
4 | 4 | Date: 11/06/2019 |
5 | 5 | |
... | ... | @@ -14,6 +14,7 @@ By: epallier@irap.omp.eu |
14 | 14 | HISTORY |
15 | 15 | |
16 | 16 | 11/06/2019 |
17 | + - Ajouté options "test" et "testall" dans pyros.py pour exécution des (anciens) tests unitaires | |
17 | 18 | - Restructuring : private/ => venv/ |
18 | 19 | |
19 | 20 | ... | ... |
pyros.py
... | ... | @@ -58,7 +58,7 @@ if IS_WINDOWS: |
58 | 58 | my_abs_path = os.path.dirname(os.path.realpath(__file__)) |
59 | 59 | VENV_BIN = ( |
60 | 60 | my_abs_path |
61 | - + os.sep + "private" | |
61 | + + os.sep + "venv" | |
62 | 62 | + os.sep + "venv_py3_pyros" |
63 | 63 | + os.sep + b_in_dir |
64 | 64 | + os.sep + PYTHON |
... | ... | @@ -300,6 +300,28 @@ def install(): |
300 | 300 | |
301 | 301 | |
302 | 302 | |
303 | +@pyros_launcher.command(help="Run some tests") | |
304 | +def test(): | |
305 | + print("Running tests") | |
306 | + #start_dir = os.getcwd() | |
307 | + apps = ['common', 'scheduler', 'routine_manager', 'user_manager', 'alert_manager.tests.TestStrategyChange'] | |
308 | + for app in apps: | |
309 | + _loaddata() or die() | |
310 | + change_dir("src") | |
311 | + execProcessFromVenv('manage.py test ' + app) or die() | |
312 | + change_dir("..") | |
313 | + # execProcess("python install.py install") | |
314 | + return True | |
315 | + | |
316 | +@pyros_launcher.command(help="Run ALL tests") | |
317 | +def testall(): | |
318 | + change_dir("src") | |
319 | + execProcessFromVenvAsync("manage.py test") | |
320 | + change_dir("..") | |
321 | + return True | |
322 | + | |
323 | + | |
324 | + | |
303 | 325 | |
304 | 326 | ''' |
305 | 327 | TODO: |
... | ... | @@ -516,6 +538,7 @@ def _loaddata(): |
516 | 538 | change_dir("..") |
517 | 539 | return res |
518 | 540 | |
541 | + | |
519 | 542 | def change_dir(path): |
520 | 543 | if DEBUG: print("Moving to : " + path) |
521 | 544 | os.chdir(path) | ... | ... |
src/majordome/majordome_test.py
... | ... | @@ -37,7 +37,7 @@ def tearDown(self): |
37 | 37 | def replacePatternInFileOrError(pattern, replace, file_path): |
38 | 38 | with fileinput.FileInput(file_path, inplace=True, backup=".bak") as file: |
39 | 39 | for line in file: |
40 | - print(line.replace(pattern, replace), end="") | |
40 | + print(line.replace(pattern, replace), end='') | |
41 | 41 | # Now, check that replacement has been done or ERROR !!! |
42 | 42 | FOUND = False |
43 | 43 | # with fileinput.FileInput(file_path) as file: | ... | ... |