Skip to main content

Utilities for integration tests against Synapse.

Project description

Build Status Coverage Status

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
def synapse_test_helper():
    synapse_client = synapseclient.Synapse()
    synapse_client.login()  # Set to use your preferred login method for Synapse.
    with SynapseTestHelper(synapse_client) 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:

  1. Rename .env.template to .env and set the variables in the file.
  2. Run make test or tox

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

synapse_test_helper-0.1.0.tar.gz (10.1 kB view hashes)

Uploaded Source

Built Distribution

synapse_test_helper-0.1.0-py3-none-any.whl (14.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page