Commit e2472f935d8c5067bcad7b79c3cce9d5c4d416d4
1 parent
65c8b8f8
Exists in
dev
Add option on test command to run one test method
Showing
5 changed files
with
12 additions
and
16 deletions
Show diff stats
CHANGELOG
VERSION
pyros.py
... | ... | @@ -708,7 +708,8 @@ def install_or_update(UPDATE: bool = False, with_packages: bool = True, with_dat |
708 | 708 | |
709 | 709 | @pyros_launcher.command(help="Run some tests") |
710 | 710 | @click.option('--app', '-a', help='app name') |
711 | -def test(app): | |
711 | +@click.option('--function', '-f', help='function name') | |
712 | +def test(app, function): | |
712 | 713 | print("Running tests") |
713 | 714 | os.environ["PATH_TO_OBSCONF_FOLDER"] = os.path.join( |
714 | 715 | os.path.abspath(PYROS_DJANGO_BASE_DIR), "obsconfig/fixtures/") |
... | ... | @@ -729,8 +730,11 @@ def test(app): |
729 | 730 | os.environ["PATH_TO_OBSCONF_FILE"] = os.path.join(os.path.abspath( |
730 | 731 | PYROS_DJANGO_BASE_DIR), "obsconfig/fixtures/observatory_configuration_ok_simple.yml") |
731 | 732 | change_dir(PYROS_DJANGO_BASE_DIR) |
733 | + cmd = 'manage.py test --keep --noinput --parallel 4 ' + app | |
734 | + if function: | |
735 | + cmd += ".tests."+function | |
732 | 736 | execProcessFromVenv( |
733 | - 'manage.py test --keep --noinput --parallel 4 ' + app,foreground=True) or die() | |
737 | + cmd, foreground=True) or die() | |
734 | 738 | change_dir("PREVIOUS") |
735 | 739 | return True |
736 | 740 | for app in apps: | ... | ... |
src/core/pyros_django/api/tests.py
... | ... | @@ -107,7 +107,7 @@ class TestAPI(APITestCase): |
107 | 107 | url = '/api/plans/1' |
108 | 108 | response = self.client.get(url,follow=True) |
109 | 109 | self.assertEqual(response.status_code,200) |
110 | - self.assertEqual(response.data.get("name"),Plan.objects.get(id=1).name) | |
110 | + self.assertEqual(response.data.get("id"),Plan.objects.get(id=1).id) | |
111 | 111 | |
112 | 112 | def test_full_sequence_list(self): |
113 | 113 | user = PyrosUser.objects.get(username="pyros") | ... | ... |
src/core/pyros_django/misc/fixtures/tests/complete_fixture.json
... | ... | @@ -5119,7 +5119,6 @@ |
5119 | 5119 | "last_modified_by": null, |
5120 | 5120 | "is_alert": false, |
5121 | 5121 | "status": "DRAFT", |
5122 | - "target_coords": "RADEC 0H10M -15D", | |
5123 | 5122 | "with_drift": false, |
5124 | 5123 | "priority": null, |
5125 | 5124 | "analysis_method": null, |
... | ... | @@ -5168,7 +5167,6 @@ |
5168 | 5167 | "last_modified_by": null, |
5169 | 5168 | "is_alert": false, |
5170 | 5169 | "status": "TBP", |
5171 | - "target_coords": null, | |
5172 | 5170 | "with_drift": false, |
5173 | 5171 | "priority": null, |
5174 | 5172 | "analysis_method": null, |
... | ... | @@ -5215,7 +5213,6 @@ |
5215 | 5213 | "last_modified_by": null, |
5216 | 5214 | "is_alert": false, |
5217 | 5215 | "status": "TBP", |
5218 | - "target_coords": null, | |
5219 | 5216 | "with_drift": false, |
5220 | 5217 | "priority": null, |
5221 | 5218 | "analysis_method": null, |
... | ... | @@ -5262,7 +5259,6 @@ |
5262 | 5259 | "last_modified_by": null, |
5263 | 5260 | "is_alert": false, |
5264 | 5261 | "status": "TBP", |
5265 | - "target_coords": null, | |
5266 | 5262 | "with_drift": false, |
5267 | 5263 | "priority": null, |
5268 | 5264 | "analysis_method": null, |
... | ... | @@ -5309,7 +5305,6 @@ |
5309 | 5305 | "last_modified_by": null, |
5310 | 5306 | "is_alert": false, |
5311 | 5307 | "status": null, |
5312 | - "target_coords": null, | |
5313 | 5308 | "with_drift": false, |
5314 | 5309 | "priority": null, |
5315 | 5310 | "analysis_method": null, |
... | ... | @@ -5352,7 +5347,6 @@ |
5352 | 5347 | "last_modified_by": null, |
5353 | 5348 | "is_alert": false, |
5354 | 5349 | "status": null, |
5355 | - "target_coords": null, | |
5356 | 5350 | "with_drift": false, |
5357 | 5351 | "priority": null, |
5358 | 5352 | "analysis_method": null, |
... | ... | @@ -5395,7 +5389,6 @@ |
5395 | 5389 | "last_modified_by": null, |
5396 | 5390 | "is_alert": false, |
5397 | 5391 | "status": "TBP", |
5398 | - "target_coords": null, | |
5399 | 5392 | "with_drift": false, |
5400 | 5393 | "priority": null, |
5401 | 5394 | "analysis_method": null, |
... | ... | @@ -5442,7 +5435,6 @@ |
5442 | 5435 | "last_modified_by": null, |
5443 | 5436 | "is_alert": false, |
5444 | 5437 | "status": "TBP", |
5445 | - "target_coords": null, | |
5446 | 5438 | "with_drift": false, |
5447 | 5439 | "priority": null, |
5448 | 5440 | "analysis_method": null, |
... | ... | @@ -5489,7 +5481,6 @@ |
5489 | 5481 | "last_modified_by": null, |
5490 | 5482 | "is_alert": false, |
5491 | 5483 | "status": "TBP", |
5492 | - "target_coords": null, | |
5493 | 5484 | "with_drift": false, |
5494 | 5485 | "priority": null, |
5495 | 5486 | "analysis_method": null, |
... | ... | @@ -5536,7 +5527,6 @@ |
5536 | 5527 | "last_modified_by": null, |
5537 | 5528 | "is_alert": false, |
5538 | 5529 | "status": null, |
5539 | - "target_coords": null, | |
5540 | 5530 | "with_drift": false, |
5541 | 5531 | "priority": null, |
5542 | 5532 | "analysis_method": null, |
... | ... | @@ -5579,7 +5569,6 @@ |
5579 | 5569 | "last_modified_by": null, |
5580 | 5570 | "is_alert": false, |
5581 | 5571 | "status": null, |
5582 | - "target_coords": null, | |
5583 | 5572 | "with_drift": false, |
5584 | 5573 | "priority": null, |
5585 | 5574 | "analysis_method": null, |
... | ... | @@ -5622,7 +5611,6 @@ |
5622 | 5611 | "last_modified_by": null, |
5623 | 5612 | "is_alert": false, |
5624 | 5613 | "status": null, |
5625 | - "target_coords": null, | |
5626 | 5614 | "with_drift": false, |
5627 | 5615 | "priority": null, |
5628 | 5616 | "analysis_method": null, | ... | ... |