Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ All notable changes to this project will be documented in this file
`filename=`; `list_folder_tree` takes `page_size=`; new `get_workbench_by_id`; Inventory
CSV import uses the shared session.
- Removed a stray debug print from `InventoryClient.upload_attachment_by_global_id`.
- Added `rspace_client/tests/mock_rspace`, an offline mock of the ELN and Inventory REST
endpoints the PyFilesystem classes use, shared by the unit suite. Not installed.

## Unreleased

Expand Down
25 changes: 25 additions & 0 deletions rspace_client/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""
pytest hooks for the offline test suite.

One mock RSpace server (``rspace_client/tests/mock_rspace``) serves the whole
session. It is started here and handed to :mod:`rspace_client.tests.mock_server_case`,
whose ``MockServerTestCase`` resets its fixtures before every test; the old
one-server-per-class arrangement spent most of the suite's wall time in seven
``serve_forever`` shutdowns.
"""
import pytest

from rspace_client.tests import mock_server_case
from rspace_client.tests.mock_rspace.server import run_in_thread


@pytest.fixture(scope="session", autouse=True)
def shared_mock_server():
server, url = run_in_thread()
mock_server_case.install_shared_server(server, url)
try:
yield server
finally:
mock_server_case.install_shared_server(None, None)
server.shutdown()
server.server_close()
6 changes: 6 additions & 0 deletions rspace_client/tests/mock_rspace/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"""
Mock RSpace API server and a Galaxy-like harness for developing and testing the
RSpace PyFilesystem implementations offline.

See rspace_client/tests/mock_rspace/README.md for usage.
"""
Loading
Loading