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.

stores_mailboxes: bool = False#

Whether the storage stores the Mailbox resources.

Set it to True to check the uniqueness of sub-attributes and of multi-valued attributes. The storage then serves the Mailbox resource type, MAILBOX_TYPE. The provider fixture serves it too.

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.Mailbox[source]#

A resource holding unique values below its attributes.

The tests of the uniqueness of sub-attributes and of multi-valued attributes create mailboxes. No two mailboxes share an alias, but two aliases differing by their case are different.

class scim2_server.testing.MailboxAddress[source]#

An address of a Mailbox. No two mailboxes share an address, whatever its case.

class scim2_server.testing.MailboxOwner[source]#

The owner of a Mailbox. No two mailboxes share an owner, whatever its case.

scim2_server.testing.MAILBOX_TYPE#

The resource type of the Mailbox resources, served at /Mailboxes.

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.