tests.test_filesystem

Attributes

CURR_DIR

Classes

BaseTestFileSystem

Base test FileSystem parent class, containing some utility functions and common setup/teardown operations.

TestFileSystemBasic

Test FileSystem generic operations.

TestFileSystemWpsOutputsUser

FileSystem tests specific to the user wps outputs data.

Module Contents

tests.test_filesystem.CURR_DIR[source]
class tests.test_filesystem.BaseTestFileSystem(methodName='runTest')[source]

Bases: unittest.TestCase

Base test FileSystem parent class, containing some utility functions and common setup/teardown operations.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

classmethod setUpClass()[source]

Hook method for setting up class fixture before running tests in the class.

classmethod tearDownClass()[source]

Hook method for deconstructing the class fixture after running all tests in the class.

setUp()[source]

Hook method for setting up the test fixture before exercising it.

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

get_test_app(cfg_data: cowbird.typedefs.JSON) webtest.app.TestApp[source]
static check_created_test_cases(output_path, hardlink_path)[source]

Runs multiple test cases, common to the public and user files, for the creation of hardlinks.

class tests.test_filesystem.TestFileSystemBasic(methodName='runTest')[source]

Bases: BaseTestFileSystem

Test FileSystem generic operations.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

test_manage_user_workspace(mock_head_request)[source]

Tests creating and deleting a user workspace.

test_create_user_missing_workspace_dir(mock_head_request)[source]

Tests creating a user directory with a missing workspace directory.

test_public_wps_output_created()[source]

Tests creating a public wps output file.

test_public_wps_output_deleted()[source]

Tests deleting a public wps output path.

test_resync()[source]

Tests resync operation for the handler.

test_resync_no_src_wps_outputs()[source]

Tests the resync operation when the source WPS outputs folder does not exist.

class tests.test_filesystem.TestFileSystemWpsOutputsUser(methodName='runTest')[source]

Bases: BaseTestFileSystem

FileSystem tests specific to the user wps outputs data.

These tests can include verifications on the different path permissions. Note that others permissions are used instead of the user/group permissions, to manage the user’s data access. See Components - Usage of ‘others’ permissions for more details on the usage of others permissions.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

setUp()[source]

Hook method for setting up the test fixture before exercising it.

create_secure_data_proxy_service()[source]

Generates a new secure-data-proxy service in Magpie app.

Checks if a path has the expected permissions, and if a hardlink exists, according to the other permissions.

test_user_wps_output_created()[source]

Tests creating wps outputs for a user.

test_user_created()[source]

Tests if creating a user generates the hardlinks to the pre-existing user WPS outputs data.

test_user_wps_output_created_secure_data_proxy()[source]

Tests creating wps outputs for a user when Magpie uses a secure-data-proxy service to manage access permissions to the wps output data.

test_user_wps_output_deleted()[source]

Tests deleting wps outputs for a user.

test_resync()[source]

Tests resync operation on WPS outputs user data.

test_permission_updates_user_data()[source]

Tests updating permissions on data found directly in a specific user directory.

test_permission_updates_wps_outputs_data()[source]

Tests updating permissions on data found outside of the user directories, including testing permissions on a user and on a group.

test_permission_updates_other_svc()[source]

Tests permission updates on a WPS outputs resource from a service other than the secure-data-proxy, which should not be processed by the filesystem handler.