Skip to content

Commit 5b26fb6

Browse files
committed
doc: tutorial page
1 parent 5a0911b commit 5b26fb6

File tree

4 files changed

+50
-14
lines changed

4 files changed

+50
-14
lines changed

README.md

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,7 @@ pip install scim2-tester
2020

2121
## Usage
2222

23-
scim2-tester provides a very basic command line:
24-
25-
```console
26-
python scim2_tester/checker.py https://scim.example
27-
```
28-
29-
However, a more complete integration is achieved through [scim2-cli](https://scim2-cli.readthedocs.io):
30-
31-
```console
32-
pip install scim2-cli
33-
scim https://scim.example test
34-
```
35-
36-
You can check the [scim2-cli test command reference](https://scim2-cli.readthedocs.io/en/latest/reference.html#scim-url-test) for more details.
23+
Check the [tutorial](https://scim2-tester.readthedocs.io/en/latest/tutorial.html) and the [reference](https://scim2-client.readthedocs.io/en/latest/reference.html) for more details.
3724

3825
scim2-tester belongs in a collection of SCIM tools developed by [Yaal Coop](https://yaal.coop),
3926
with [scim2-models](https://github.com/python-scim/scim2-models),

doc/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"scim2_models": ("https://scim2-models.readthedocs.io/en/latest/", None),
4747
"scim2_client": ("https://scim2-client.readthedocs.io/en/latest/", None),
4848
"scim2_cli": ("https://scim2-cli.readthedocs.io/en/latest/", None),
49+
"werkzeug": ("https://werkzeug.palletsprojects.com", None),
4950
}
5051

5152
# -- Options for HTML output ----------------------------------------------

doc/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Table of contents
77
.. toctree::
88
:maxdepth: 2
99

10+
tutorial
1011
reference
1112
contributing
1213
changelog

doc/tutorial.rst

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
Tutorial
2+
--------
3+
4+
Basic CLI
5+
=========
6+
7+
scim2-tester provides a very basic command line:
8+
9+
.. code-block:: console
10+
11+
python scim2_tester/checker.py https://scim.example
12+
13+
However, we encourage you to use the more complete integration in :doc:`scim2-cli <scim2_cli:index>`:
14+
15+
.. code-block:: console
16+
17+
pip install scim2-cli
18+
scim https://scim.example test
19+
20+
You can check the :ref:`scim2-cli test command reference <scim2_cli:test>` for more details.
21+
22+
Unit test suite integration
23+
===========================
24+
25+
If you build a Python SCIM sever application and need a complete test suite to check you implementation, you can integrate `scim2-tester` in your test suite with little effort.
26+
Thanks to scim2-client :class:`~scim2_client.engines.werkzeug.TestSCIMClient` engine, no real HTTP request is made, but the server code is directly executed.
27+
This allows you to catch server exceptions in the test contexts, which is very handy for development.
28+
29+
As :class:`~scim2_client.engines.werkzeug.TestSCIMClient` relies on :doc:`Werkzeug <werkzeug:index>`, you need to check that you have installed the right dependencies to use it:
30+
31+
.. code-block:: console
32+
33+
uv add --group dev scim2-models[werkzeug]
34+
35+
.. code-block:: python
36+
37+
from scim2_models import User, Group
38+
from scim2_client.engines.werkzeug import TestSCIMClient
39+
from scim2_tester import check_server, Status
40+
from myapp import create_app
41+
42+
def test_scim_tester():
43+
app = create_app(...)
44+
client = TestSCIMClient(app=app, scim_prefix="/scim/v2", resource_models=(User, Group))
45+
results = check_server(client)
46+
for result in results:
47+
assert result.status == Status.SUCCESS

0 commit comments

Comments
 (0)