How To Install python3-requests-mock on Rocky Linux 8

In this tutorial we learn how to install python3-requests-mock on Rocky Linux 8. python3-requests-mock is A requests mocking tool for python

Introduction

In this tutorial we learn how to install python3-requests-mock on Rocky Linux 8.

What is python3-requests-mock

requests-mock provides a simple way to do HTTP mocking at the python-requests layer.

We can use yum or dnf to install python3-requests-mock on Rocky Linux 8. In this tutorial we discuss both methods but you only need to choose one of method to install python3-requests-mock.

Install python3-requests-mock on Rocky Linux 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

After updating yum database, We can install python3-requests-mock using dnf by running the following command:

sudo dnf -y install python3-requests-mock

Install python3-requests-mock on Rocky Linux 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

After updating yum database, We can install python3-requests-mock using yum by running the following command:

sudo yum -y install python3-requests-mock

How To Uninstall python3-requests-mock on Rocky Linux 8

To uninstall only the python3-requests-mock package we can use the following command:

sudo dnf remove python3-requests-mock

python3-requests-mock Package Contents on Rocky Linux 8

/usr/lib/python3.6/site-packages/requests_mock
/usr/lib/python3.6/site-packages/requests_mock-1.7.0-py3.6.egg-info
/usr/lib/python3.6/site-packages/requests_mock-1.7.0-py3.6.egg-info/PKG-INFO
/usr/lib/python3.6/site-packages/requests_mock-1.7.0-py3.6.egg-info/SOURCES.txt
/usr/lib/python3.6/site-packages/requests_mock-1.7.0-py3.6.egg-info/dependency_links.txt
/usr/lib/python3.6/site-packages/requests_mock-1.7.0-py3.6.egg-info/entry_points.txt
/usr/lib/python3.6/site-packages/requests_mock-1.7.0-py3.6.egg-info/not-zip-safe
/usr/lib/python3.6/site-packages/requests_mock-1.7.0-py3.6.egg-info/requires.txt
/usr/lib/python3.6/site-packages/requests_mock-1.7.0-py3.6.egg-info/top_level.txt
/usr/lib/python3.6/site-packages/requests_mock/__init__.py
/usr/lib/python3.6/site-packages/requests_mock/__pycache__
/usr/lib/python3.6/site-packages/requests_mock/__pycache__/__init__.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/requests_mock/__pycache__/__init__.cpython-36.pyc
/usr/lib/python3.6/site-packages/requests_mock/__pycache__/adapter.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/requests_mock/__pycache__/adapter.cpython-36.pyc
/usr/lib/python3.6/site-packages/requests_mock/__pycache__/compat.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/requests_mock/__pycache__/compat.cpython-36.pyc
/usr/lib/python3.6/site-packages/requests_mock/__pycache__/exceptions.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/requests_mock/__pycache__/exceptions.cpython-36.pyc
/usr/lib/python3.6/site-packages/requests_mock/__pycache__/mocker.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/requests_mock/__pycache__/mocker.cpython-36.pyc
/usr/lib/python3.6/site-packages/requests_mock/__pycache__/request.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/requests_mock/__pycache__/request.cpython-36.pyc
/usr/lib/python3.6/site-packages/requests_mock/__pycache__/response.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/requests_mock/__pycache__/response.cpython-36.pyc
/usr/lib/python3.6/site-packages/requests_mock/adapter.py
/usr/lib/python3.6/site-packages/requests_mock/compat.py
/usr/lib/python3.6/site-packages/requests_mock/contrib
/usr/lib/python3.6/site-packages/requests_mock/contrib/__init__.py
/usr/lib/python3.6/site-packages/requests_mock/contrib/__pycache__
/usr/lib/python3.6/site-packages/requests_mock/contrib/__pycache__/__init__.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/requests_mock/contrib/__pycache__/__init__.cpython-36.pyc
/usr/lib/python3.6/site-packages/requests_mock/contrib/__pycache__/_pytest_plugin.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/requests_mock/contrib/__pycache__/_pytest_plugin.cpython-36.pyc
/usr/lib/python3.6/site-packages/requests_mock/contrib/__pycache__/fixture.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/requests_mock/contrib/__pycache__/fixture.cpython-36.pyc
/usr/lib/python3.6/site-packages/requests_mock/contrib/_pytest_plugin.py
/usr/lib/python3.6/site-packages/requests_mock/contrib/fixture.py
/usr/lib/python3.6/site-packages/requests_mock/exceptions.py
/usr/lib/python3.6/site-packages/requests_mock/mocker.py
/usr/lib/python3.6/site-packages/requests_mock/request.py
/usr/lib/python3.6/site-packages/requests_mock/response.py
/usr/share/doc/python3-requests-mock
/usr/share/doc/python3-requests-mock/ChangeLog
/usr/share/doc/python3-requests-mock/README.rst
/usr/share/licenses/python3-requests-mock
/usr/share/licenses/python3-requests-mock/LICENSE

References

Summary

In this tutorial we learn how to install python3-requests-mock on Rocky Linux 8 using yum and dnf.