-
Notifications
You must be signed in to change notification settings - Fork 0
feat(save_and_load): add import/export methods #108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
MaxNumerique
wants to merge
14
commits into
next
Choose a base branch
from
feat/save_and_load
base: next
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
1758f43
feat(import_project): new schema, rpc added to reset viewer and prepa…
MaxNumerique 8343da2
clean database session before initializing a new one
MaxNumerique 34933a2
Apply prepare changes
MaxNumerique a8f1a05
add import project schema and replace reset project
MaxNumerique f425483
Merge branch 'feat/save_and_load' of https://github.com/Geode-solutio…
MaxNumerique 0dd5977
Apply prepare changes
MaxNumerique 2461e11
type
MaxNumerique da99ae7
Merge branch 'feat/save_and_load' of https://github.com/Geode-solutio…
MaxNumerique 8bbac39
test
MaxNumerique 3870e81
Apply prepare changes
MaxNumerique 15f1aeb
to_dict()
MaxNumerique 3732c42
cast used
MaxNumerique 4540bfc
delete former reset_project type file
MaxNumerique 9bc5635
test
MaxNumerique File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -61,4 +61,3 @@ wslink==1.12.4 | |
| yarl>=1 | ||
| # via aiohttp | ||
|
|
||
| opengeodeweb-microservice==1.*,>=1.0.6rc1 | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| from .kill import * | ||
| from .import_project import * |
This file contains hidden or 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,7 @@ | ||
| { | ||
| "rpc": "import_project", | ||
| "type": "object", | ||
| "properties": {}, | ||
| "required": [], | ||
| "additionalProperties": false | ||
| } |
This file contains hidden or 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,7 @@ | ||
| from dataclasses_json import DataClassJsonMixin | ||
| from dataclasses import dataclass | ||
|
|
||
|
|
||
| @dataclass | ||
| class ImportProject(DataClassJsonMixin): | ||
| pass |
This file contains hidden or 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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,46 @@ | ||
| from typing import Callable | ||
| from opengeodeweb_viewer.rpc.utils_protocols import VtkUtilsView | ||
| from opengeodeweb_viewer.rpc.viewer.viewer_protocols import VtkViewerView | ||
| from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView | ||
| from opengeodeweb_microservice.database.connection import get_session | ||
| from opengeodeweb_microservice.database.data import Data | ||
| from tests.conftest import ServerMonitor | ||
|
|
||
|
|
||
| def test_reset_project_after_import( | ||
| server: ServerMonitor, dataset_factory: Callable[..., str] | ||
| ) -> None: | ||
| # Mock | ||
| pre_id = "123456789" | ||
| dataset_factory(id=pre_id, viewable_file_name="hat.vtp") | ||
| server.call( | ||
| VtkMeshView.mesh_prefix + VtkMeshView.mesh_schemas_dict["register"]["rpc"], | ||
| [{"id": pre_id}], | ||
| ) | ||
| assert server.compare_image(3, "mesh/register.jpeg") is True | ||
|
|
||
| # Import | ||
| with get_session() as session: | ||
| session.query(Data).delete() | ||
| session.commit() | ||
|
|
||
| post_id = "987654321" | ||
| dataset_factory(id=post_id, viewable_file_name="hat.vtp") | ||
|
|
||
| server.call( | ||
| VtkUtilsView.utils_prefix | ||
| + VtkUtilsView.utils_schemas_dict["import_project"]["rpc"] | ||
| ) | ||
| server.get_response() | ||
|
|
||
| server.call( | ||
| VtkViewerView.viewer_prefix | ||
| + VtkViewerView.viewer_schemas_dict["reset_visualization"]["rpc"] | ||
| ) | ||
| assert server.compare_image(3, "viewer/reset_visualization.jpeg") is True | ||
|
|
||
| server.call( | ||
| VtkMeshView.mesh_prefix + VtkMeshView.mesh_schemas_dict["register"]["rpc"], | ||
| [{"id": post_id}], | ||
| ) | ||
| assert server.compare_image(3, "viewer/import_project.jpeg") is True |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.