How To Install python-pook-doc on Debian 12

Learn how to install python-pook-doc on Debian 12 with this tutorial. python-pook-doc is HTTP traffic mocking and testing made easy (common documentation)

Introduction

In this tutorial we learn how to install python-pook-doc on Debian 12.

What is python-pook-doc

python-pook-doc is:

Versatile, expressive and hackable utility library for HTTP traffic mocking and expectations made easy in Python. Heavily inspired by gock.

Features:

  • Simple, expressive and fluent API.
  • Provides both Pythonic and chainable DSL API styles.
  • Full-featured HTTP response definitions and expectations.
  • Matches any HTTP protocol primitive (URL, method, query params, headers, body…).
  • Full regular expressions capable mock expectations matching.
  • Supports most popular HTTP clients via interceptor adapters.
  • Configurable volatile, persistent or TTL limited mocks.
  • Works with any testing framework/engine (unittest, pytest, nosetests…).
  • First-class JSON & XML support matching and responses.
  • Supports JSON Schema body matching.
  • Works in both runtime and testing environments.
  • Can be used as decorator and/or via context managers.
  • Supports real networking mode with optional traffic filtering.
  • Map/filter mocks easily for generic or custom mock expectations.
  • Custom user-defined mock matcher functions.
  • Simulated raised error exceptions.
  • Network delay simulation (only available for aiohttp).
  • Pluggable and hackable API.
  • Customizable HTTP traffic mock interceptor engine.
  • Supports third-party mocking engines, such as mocket.
  • Fits good for painless test doubles.
  • Does not support WebSocket traffic mocking.
  • Works with Python +2.7 and +3.0 (including PyPy).
  • Dependency-less: just 2 small dependencies for JSONSchema and XML tree comparison.

This is the common documentation package.

There are three methods to install python-pook-doc on Debian 12. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install python-pook-doc Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install python-pook-doc using apt-get by running the following command:

sudo apt-get -y install python-pook-doc

Install python-pook-doc Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install python-pook-doc using apt by running the following command:

sudo apt -y install python-pook-doc

Install python-pook-doc Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Debian. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install python-pook-doc using aptitude by running the following command:

sudo aptitude -y install python-pook-doc

How To Uninstall python-pook-doc on Debian 12

To uninstall only the python-pook-doc package we can use the following command:

sudo apt-get remove python-pook-doc

Uninstall python-pook-doc And Its Dependencies

To uninstall python-pook-doc and its dependencies that are no longer needed by Debian 12, we can use the command below:

sudo apt-get -y autoremove python-pook-doc

Remove python-pook-doc Configurations and Data

To remove python-pook-doc configuration and data from Debian 12 we can use the following command:

sudo apt-get -y purge python-pook-doc

Remove python-pook-doc configuration, data, and all of its dependencies

We can use the following command to remove python-pook-doc configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge python-pook-doc

Dependencies

python-pook-doc have the following dependencies:

References

Summary

In this tutorial we learn how to install python-pook-doc package on Debian 12 using different package management tools: apt, apt-get and aptitude.