-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial work for distributed evaluation
- Loading branch information
1 parent
e1988e1
commit 576fb10
Showing
6 changed files
with
82 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
...evaluationservice/dmod/evaluationservice/evaluation_service/tests/test_templatemanager.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
from pathlib import Path | ||
|
||
from django.test import TestCase | ||
|
||
from dmod.evaluations.specification import TemplateManager | ||
from evaluation_service import specification | ||
|
||
|
||
# Create your tests here. | ||
class SpecificationTemplateManager(TestCase): | ||
""" | ||
Tests to ensure that the SpecificationTemplateManager operates as expected, especially when it comes to exports | ||
""" | ||
control_manager: specification.SpecificationTemplateManager | ||
export_directory: Path | ||
|
||
@classmethod | ||
def setUpClass(cls) -> None: | ||
""" | ||
Set up the SpecificationTemplateManager that serves as a control for the tests and form the export path | ||
""" | ||
super().setUpClass() | ||
cls.export_directory = Path(__file__).parent / 'data' / 'writing' / cls.__name__ | ||
cls.export_directory.mkdir(parents=True, exist_ok=True) | ||
|
||
@classmethod | ||
def tearDownClass(cls) -> None: | ||
""" | ||
Remove all artifacts generated by this test | ||
""" | ||
super().tearDownClass() | ||
cls.export_directory.rmdir() | ||
|
||
def test_database_export(self): | ||
""" | ||
Test to ensure that `self.control_manager.export_database` works | ||
""" | ||
... | ||
|
||
def test_inmemory_export(self): | ||
""" | ||
Test to ensure that the contents of the control_manager can be exported into an inmemory object and reloaded | ||
into another manager | ||
""" | ||
... | ||
|
||
def test_file_export(self): | ||
""" | ||
Test to ensure that the contents of the control manager can be correctly exported to files | ||
""" | ||
... | ||
|
||
def test_file_imports(self): | ||
""" | ||
Test the control_manager to ensure that its contents are correct for the other tests | ||
""" | ||
self.verify_templatemanager_contents(self.control_manager) | ||
|
||
def verify_templatemanager_contents(self, manager: TemplateManager): | ||
""" | ||
Ensure that the passed in manager contain the correct contents | ||
Args: | ||
manager: The manager whose contents to test | ||
""" | ||
... |