Skip to content

Test fixtures for providing fake versions of various system resources (processes, users, groups, etc.)

License

Notifications You must be signed in to change notification settings

testing-cabal/systemfixtures

Repository files navigation

System fixtures

Latest Version Build Status Coverage Documentation Status

A collection of Python fixtures to fake out various system resources (processes, users, groups, etc.).

Each fake resource typically behaves as an "overlay" on the real resource, in that it can be programmed with fake behavior for a set of inputs, but falls back to the real behavior for the rest.

>>> import pwd

>>> from systemfixtures import FakeUsers

>>> users = FakeUsers()
>>> users.setUp()

>>> pwd.getpwnam("foo")
Traceback (most recent call last):
...
KeyError: 'getpwnam(): name not found: foo'

>>> users.add("foo", 123)
>>> info = pwd.getpwnam("foo")
>>> info.pw_uid
123
>>> users.cleanUp()

Support and Documentation

See the online documentation for a complete reference.

Developing and Contributing

See the GitHub project. Bugs can be filed in the issues tracker.

About

Test fixtures for providing fake versions of various system resources (processes, users, groups, etc.)

Resources

License

Stars

Watchers

Forks

Packages

No packages published