-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1009 from mapswipe/add-tutorial-tests
feat: add unittest for each tutorial
- Loading branch information
Showing
7 changed files
with
111 additions
and
0 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
27 changes: 27 additions & 0 deletions
27
mapswipe_workers/tests/unittests/test_tutorial_arbitrary_geometry_footprint.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,27 @@ | ||
import os | ||
import unittest | ||
|
||
from mapswipe_workers.project_types import FootprintTutorial | ||
from tests.fixtures import FIXTURE_DIR, get_fixture | ||
|
||
|
||
class TestTutorial(unittest.TestCase): | ||
def test_init_arbitrary_geometry_footprint_project(self): | ||
tutorial_draft = get_fixture( | ||
os.path.join(FIXTURE_DIR, "tutorialDrafts", "footprint.json") | ||
) | ||
self.assertIsNotNone(FootprintTutorial(tutorial_draft=tutorial_draft)) | ||
|
||
def test_create_arbitrary_geometry_footprint_tasks(self): | ||
tutorial_draft = get_fixture( | ||
os.path.join(FIXTURE_DIR, "tutorialDrafts", "footprint.json") | ||
) | ||
tutorial = FootprintTutorial(tutorial_draft=tutorial_draft) | ||
tutorial.create_tutorial_groups() | ||
tutorial.create_tutorial_tasks() | ||
self.assertTrue(tutorial.groups) | ||
self.assertTrue(tutorial.tasks) | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |
27 changes: 27 additions & 0 deletions
27
mapswipe_workers/tests/unittests/test_tutorial_tile_change_detection.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,27 @@ | ||
import os | ||
import unittest | ||
|
||
from mapswipe_workers.project_types import ChangeDetectionTutorial | ||
from tests.fixtures import FIXTURE_DIR, get_fixture | ||
|
||
|
||
class TestTutorial(unittest.TestCase): | ||
def test_init_tile_change_detection_project(self): | ||
tutorial_draft = get_fixture( | ||
os.path.join(FIXTURE_DIR, "tutorialDrafts", "change_detection.json") | ||
) | ||
self.assertIsNotNone(ChangeDetectionTutorial(tutorial_draft=tutorial_draft)) | ||
|
||
def test_create_tile_change_detection_tasks(self): | ||
tutorial_draft = get_fixture( | ||
os.path.join(FIXTURE_DIR, "tutorialDrafts", "change_detection.json") | ||
) | ||
tutorial = ChangeDetectionTutorial(tutorial_draft=tutorial_draft) | ||
tutorial.create_tutorial_groups() | ||
tutorial.create_tutorial_tasks() | ||
self.assertTrue(tutorial.groups) | ||
self.assertTrue(tutorial.tasks) | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |
27 changes: 27 additions & 0 deletions
27
mapswipe_workers/tests/unittests/test_tutorial_tile_classification.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,27 @@ | ||
import os | ||
import unittest | ||
|
||
from mapswipe_workers.project_types import ClassificationTutorial | ||
from tests.fixtures import FIXTURE_DIR, get_fixture | ||
|
||
|
||
class TestTutorial(unittest.TestCase): | ||
def test_init_tile_classification_project(self): | ||
tutorial_draft = get_fixture( | ||
os.path.join(FIXTURE_DIR, "tutorialDrafts", "tile_classification.json") | ||
) | ||
self.assertIsNotNone(ClassificationTutorial(tutorial_draft=tutorial_draft)) | ||
|
||
def test_create_tile_classification_tasks(self): | ||
tutorial_draft = get_fixture( | ||
os.path.join(FIXTURE_DIR, "tutorialDrafts", "tile_classification.json") | ||
) | ||
tutorial = ClassificationTutorial(tutorial_draft=tutorial_draft) | ||
tutorial.create_tutorial_groups() | ||
tutorial.create_tutorial_tasks() | ||
self.assertTrue(tutorial.groups) | ||
self.assertTrue(tutorial.tasks) | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |
27 changes: 27 additions & 0 deletions
27
mapswipe_workers/tests/unittests/test_tutorial_tile_completeness.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,27 @@ | ||
import os | ||
import unittest | ||
|
||
from mapswipe_workers.project_types import CompletenessTutorial | ||
from tests.fixtures import FIXTURE_DIR, get_fixture | ||
|
||
|
||
class TestTutorial(unittest.TestCase): | ||
def test_init_tile_completeness_project(self): | ||
tutorial_draft = get_fixture( | ||
os.path.join(FIXTURE_DIR, "tutorialDrafts", "completeness.json") | ||
) | ||
self.assertIsNotNone(CompletenessTutorial(tutorial_draft=tutorial_draft)) | ||
|
||
def test_create_tile_completeness_tasks(self): | ||
tutorial_draft = get_fixture( | ||
os.path.join(FIXTURE_DIR, "tutorialDrafts", "completeness.json") | ||
) | ||
tutorial = CompletenessTutorial(tutorial_draft=tutorial_draft) | ||
tutorial.create_tutorial_groups() | ||
tutorial.create_tutorial_tasks() | ||
self.assertTrue(tutorial.groups) | ||
self.assertTrue(tutorial.tasks) | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |