testinfra 1.4.4
pip install testinfra==1.4.4
Newer version available (6.0.0)
Released:
Test infrastructures
Navigation
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: Apache Software License (UNKNOWN)
- Author: Philippe Pepiot
Classifiers
- Development Status
- Environment
- Framework
- Intended Audience
- License
- Operating System
- Programming Language
- Topic
Project description
Latest documentation: https://testinfra.readthedocs.io/en/latest
About
With Testinfra you can write unit tests in Python to test actual state of your servers configured by managements tools like Salt, Ansible, Puppet, Chef and so on.
Testinfra aims to be a Serverspec equivalent in python and is written as a plugin to the powerful Pytest test engine
Quick start
Install testinfra using pip:
$ pip install testinfra # or install the devel version $ pip install 'git+https://github.com/philpep/testinfra@master#egg=testinfra'
Write your first tests file to test_myinfra.py:
def test_passwd_file(File): passwd = File("/etc/passwd") assert passwd.contains("root") assert passwd.user == "root" assert passwd.group == "root" assert passwd.mode == 0o644 def test_nginx_is_installed(Package): nginx = Package("nginx") assert nginx.is_installed assert nginx.version.startswith("1.2") def test_nginx_running_and_enabled(Service): nginx = Service("nginx") assert nginx.is_running assert nginx.is_enabled
And run it:
$ testinfra -v test_myinfra.py ====================== test session starts ====================== platform linux -- Python 2.7.3 -- py-1.4.26 -- pytest-2.6.4 plugins: testinfra collected 3 items test_myinfra.py::test_passwd_file[local] PASSED test_myinfra.py::test_nginx_is_installed[local] PASSED test_myinfra.py::test_nginx_running_and_enabled[local] PASSED =================== 3 passed in 0.66 seconds ====================
Project details
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: Apache Software License (UNKNOWN)
- Author: Philippe Pepiot
Classifiers
- Development Status
- Environment
- Framework
- Intended Audience
- License
- Operating System
- Programming Language
- Topic
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file testinfra-1.4.4.tar.gz
.
File metadata
- Download URL: testinfra-1.4.4.tar.gz
- Upload date:
- Size: 61.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a0520739640825aaa16420986add74693a9fccbb701becb8a94c849a549506e |
|
MD5 | 699749c0a962f54bc3840536f8949fdc |
|
BLAKE2b-256 | 0126a15bfbc80f7ec08ca3a39796618bfe88858c53c2ea5a02b80b4e9468b085 |
File details
Details for the file testinfra-1.4.4-py2.py3-none-any.whl
.
File metadata
- Download URL: testinfra-1.4.4-py2.py3-none-any.whl
- Upload date:
- Size: 58.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe5e8c53c8542018230ae0ab82d88d6217880546fdc9b54d523cf3f8ff2164cc |
|
MD5 | e5b44db17b23b9cb9785e89ffa5d0c7a |
|
BLAKE2b-256 | 761712ab06fa8db7cd304b591b5694c14a16352ba111bc30b2dfc2aeef0d2655 |