Contract tests#

The test suites checking that a storage follows the storage contract. They need the testing extra.

class scim2_server.testing.ScimStorageContract[source]#

The rules every ScimStorage follows.

The suite uses the User and Group resource types of the provider fixture, which serves the default resource types of RFC 7643 unless overridden. The tests of a feature that the configuration of the provider does not announce, such as sorting, are skipped. So are the tests of the cursors, unless the storage supports_cursors.

Whether the storage searches several resource types at once.

Set it to False for a storage raising NotImplementedException in that case.

stores_created: bool = True#

Whether the storage stores meta.created.

Set it to False for a storage that leaves meta.created empty.

stores_last_modified: bool = True#

Whether the storage stores meta.lastModified.

Set it to False for a storage that leaves meta.lastModified empty.

stores_password: bool = True#

Whether the storage stores the password of the users.

Set it to False only for a storage that does not keep the password at all. The tests of the write-only and never returned attributes are then skipped. A storage that keeps a hash of the password stores it: its get() returns the hash.

search_users() → list[dict[str, Any]][source]#

Return the users the filter and sort tests search.

Override it to leave out the attributes the storage does not store.

class scim2_server.testing.AsyncScimStorageContract[source]#

The rules every AsyncScimStorage follows.

These are the rules of ScimStorageContract. Each test runs the coroutines of the storage on a single event loop, one after the other.