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.3.tar.gz (41.6 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.3-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pytest_scim2_server-0.1.3.tar.gz
  • Upload date:
  • Size: 41.6 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.3.tar.gz
Algorithm Hash digest
SHA256 899aca2947dba80021ba048d86a882cba9950685f16b4cabba24331e0d292036
MD5 778beff3eb261ccd26af2d901035d072
BLAKE2b-256 7d02b7007a29b447fd6d388709d4c3dcd0ce479607ed1b49f85c8b10724b1331

See more details on using hashes here.

Provenance

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

Publisher: release.yml on azmeuk/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.3-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_scim2_server-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 afff5d506e9c8bfb4fe7c6375e1ff0f1155370ddc39227b1f66243ffad205629
MD5 2af994dbb4fc19c19dd9d72c9fa21b65
BLAKE2b-256 0095f13ef81cf3c6e462d53222d1ac83359b18f35b28a32a5d278f0bc9ead131

See more details on using hashes here.

Provenance

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

Publisher: release.yml on azmeuk/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