Skip to main content

SCIM2 server fixture for Pytest

Project description

pytest-scim2-server

SCIM2 server fixture for Pytest

Installation

pip install pytest-scim2-server

Usage

pytest-scim2-server creates a scim2_server fixture that runs an instance of scim2-server on a random port, in a dedicated thread.

import requests

def test_scim_foobar(scim2_server):
    res = request.get(f"http://localhost:{scim2_server.port}")
    ...

Note that you can use scim2-client to interact with the SCIM server.

import pytest
from httpx import Client
from scim2_client.engines.httpx import SyncSCIMClient


@pytest.fixture(scope="session")
def scim_client(scim2_server):
    http_client = Client(base_url=f"http://localhost:{scim2_server.port}")
    scim_client = SyncSCIMClient(http_client)
    scim_client.discover()
    return scim_client


def test_scim2_server(scim_client):
    User = scim_client.get_resource_model("User")
    user = User(user_name="bjensen@example.com")
    response = scim_client.create(user)

    users = scim_client.query(User)
    assert users.resources[0].id == response.id

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

pytest_scim2_server-0.1.4.tar.gz (44.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_scim2_server-0.1.4-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file pytest_scim2_server-0.1.4.tar.gz.

File metadata

  • Download URL: pytest_scim2_server-0.1.4.tar.gz
  • Upload date:
  • Size: 44.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pytest_scim2_server-0.1.4.tar.gz
Algorithm Hash digest
SHA256 72a5a635f27333d97e0fb09398370e791d237b5e56ba9d327873f918756b88b3
MD5 4a6d89814b3025e1348fe3eaa1ea9363
BLAKE2b-256 5b6849dd749cf57b058a57a4523fc18e48f73affd5fc0e325d878abdcaae935d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_scim2_server-0.1.4.tar.gz:

Publisher: release.yml on pytest-dev/pytest-scim2-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytest_scim2_server-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_scim2_server-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 772d30aa0a5e4d7aca0696e9e0ccefc8b1d7345f0f93b0bef74961ef4b5501d7
MD5 c7b496e52204d41ebf31bfc01f89cbca
BLAKE2b-256 901a84af0b64340ea0549163a163415b51489c97e5a4365e7d3d62a899b4fd1f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_scim2_server-0.1.4-py3-none-any.whl:

Publisher: release.yml on pytest-dev/pytest-scim2-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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