This pytest plugin simplifies the testing of Netbox infrastructure by providing fixtures that run a complete Docker environment. No need for complex setups, just install the plugin and start testing with predefined Netbox configurations. Ensure a seamless development experience with efficient container management.
Pytest Netbox Docker is a specialized plugin for the Pytest framework, designed to simplify the testing of applications that depend on a complete Netbox infrastructure. Utilizing Docker, this plugin provides essential fixtures that allow developers to spin up a robust Netbox environment effortlessly, eliminating the complexities associated with manually setting up dependencies.
To utilize the netbox fixture in a test:
import requests
def test_mytest(netbox):
resp = requests.get("http://localhost:8080/login/")
resp.raise_for_status()
Activate the plugin when running your test suite with the following command:
pytest -p pytest_netbox_docker
Note: Ensure that port 8080 on localhost is available, as the Netbox web server will use this port. Additionally, be aware that Netbox may take some time to start and apply migrations before becoming fully operational.
No comments yet.
Sign in to be the first to comment.