tests.test_geoserver
These tests require a working Geoserver instance.
They can be run with the Make test-geoserver target. More integration tests should be in Jupyter Notebook format as is the case with Birdhouse-deploy / DACCS platform.
Attributes
Classes
Test cases to validate the synchronization between Magpie permissions and file permissions in a Geoserver workspace. |
Functions
Setup basic parameters for an unmodified local test run (using the example files) unless environment variables are |
|
|
Prepares a workspace, its datastore and a test shapefile along with the associated Geoserver resources. |
|
Removes a workspace on the file system and the associated resources on Geoserver. |
|
|
|
Module Contents
- tests.test_geoserver.get_geoserver_settings()[source]
Setup basic parameters for an unmodified local test run (using the example files) unless environment variables are set.
- tests.test_geoserver.prepare_geoserver_test_workspace(test_instance: TestGeoserver, geoserver_handler: cowbird.handlers.impl.geoserver.Geoserver, workspace_key: str) Tuple[str, str] [source]
Prepares a workspace, its datastore and a test shapefile along with the associated Geoserver resources.
- tests.test_geoserver.reset_geoserver_test_workspace(test_instance, geoserver_handler)[source]
Removes a workspace on the file system and the associated resources on Geoserver.
- class tests.test_geoserver.TestGeoserverRequests[source]
Bases:
TestGeoserver
- test_workspace_creation(geoserver: cowbird.handlers.impl.geoserver.Geoserver) None [source]
- test_empty_workspace_removal(geoserver: cowbird.handlers.impl.geoserver.Geoserver) None [source]
- test_duplicate_workspace(geoserver: cowbird.handlers.impl.geoserver.Geoserver) None [source]
- test_workspace_removal(geoserver: cowbird.handlers.impl.geoserver.Geoserver) None [source]
- test_datastore_creation(geoserver: cowbird.handlers.impl.geoserver.Geoserver) None [source]
- test_datastore_creation_missing_workspace(geoserver: cowbird.handlers.impl.geoserver.Geoserver) None [source]
- test_datastore_configuration(geoserver: cowbird.handlers.impl.geoserver.Geoserver) None [source]
- test_duplicate_datastore(geoserver: cowbird.handlers.impl.geoserver.Geoserver) None [source]
- test_publish_and_remove_shapefile(geoserver: cowbird.handlers.impl.geoserver.Geoserver) None [source]
- class tests.test_geoserver.TestGeoserverPermissions[source]
Bases:
TestGeoserver
Test cases to validate the synchronization between Magpie permissions and file permissions in a Geoserver workspace.
See Components - Geoserver for more details on the design/implementation choices.
- check_magpie_permissions(res_id, expected_perms, expected_access=Access.ALLOW.value, expected_scope=Scope.MATCH.value, effective=True)[source]
Checks if a resource has the expected permissions on Magpie for a specific access and scope value.
- test_shapefile_on_created()[source]
Tests if the right Magpie permissions are created upon a shapefile creation in a Geoserver workspace.
- test_shapefile_on_modified()[source]
Tests if the right Magpie permissions are updated upon a shapefile permission modification in a Geoserver workspace.
- test_shapefile_on_modified_other_ext()[source]
Tests modification events on any other file of the shapefile that does not have the main extension (.shp), which should not trigger any other event or modification.
- test_shapefile_on_deleted()[source]
Tests if the right Magpie permissions are deleted upon a shapefile removal in a Geoserver workspace.
- test_workspace_on_modified()[source]
Tests if Magpie resources associated with the user workspace are updated correctly.
- test_workspace_on_deleted(caplog)[source]
Tests if Magpie resources associated with the user workspace are deleted only when a user_deleted event is triggered.
- test_magpie_layer_permissions()[source]
Tests modifications on layer permissions on Magpie and the resulting updates of the permissions on the related files.
- apply_and_check_recursive_permissions(resource_id, resource_name)[source]
Used in different test cases to check the creation and deletion of a recursive permission on Magpie, validating if the resource’s files and all the children resources’ files are updated.
- test_magpie_workspace_permission()[source]
Tests modifications on a workspace’s recursive permissions on Magpie and the updates of the related files.