Utilities for integration tests against Synapse.
Project description
synapse-test-helper
Utilities for integration testing against Synapse.
Installation
pip install synapse-test-helper
Usage
Create a fixture that yields a configured instance of SynapseTestHelper using the context manager.
Example:
conftest.py:
from synapse_test_helper import SynapseTestHelper
@pytest.fixture(scope='session', autouse=True)
def syn_client():
synapse_client = synapseclient.Synapse()
synapse_client.login() # Set to use your preferred login method for Synapse.
SynapseTestHelper.configure(synapse_client)
return synapse_client
@pytest.fixture
def synapse_test_helper():
with SynapseTestHelper() as sth:
yield sth
test_my_stuff.py:
def test_my_fuction(synapse_test_helper):
project = synapse_test_helper.create_project()
# other test code...
# when this method ends the project will be deleted on Synapse.
Development Setup
git clone https://github.com/ki-tools/synapse-test-helper-py.git
cd synapse-test-helper-py
pipenv --three
pipenv shell
make pip_install
Run tests:
- Rename
.env.template
to.env
and set the variables in the file. - Run
make test
ortox
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for synapse-test-helper-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e7cae4f63e6a8e23dfd27f0feef73802994e93396dd896940cf0e922080039c |
|
MD5 | 27e43d69aed2ad0885dd4813906e2596 |
|
BLAKE2b-256 | 0bbe798fe060dd38d4d475f5d484c297859ce8f58e3b32a254904c62e0e24793 |
Close
Hashes for synapse_test_helper-0.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79124efcead0348a688f4b11e908c551d0605d5a4640343912fcfb4d2b7c76a4 |
|
MD5 | b269304d72dadd07f1f4448d2dddbf3b |
|
BLAKE2b-256 | 3315f85a80d31fad3f7b8ebce9e3c4d3633d881970b32db454b38f212740374e |