From a939a6901ad77b3503c98eecba5931f961d0939d Mon Sep 17 00:00:00 2001 From: Didier Raboud Date: Tue, 22 May 2012 10:44:43 +0200 Subject: [PATCH] PyUT: Add a fake apt-cache for testing purposes. --- debian/rules | 2 +- test/apt-cache | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100755 test/apt-cache diff --git a/debian/rules b/debian/rules index ec2bbff..b5690dd 100755 --- a/debian/rules +++ b/debian/rules @@ -54,7 +54,7 @@ test-python2.6: # Tests are not backported to python2.6, sorry. test-python%: - PYTHONPATH=. python$* test/test_lsb_release.py -vv + PATH=test/:$${PATH} PYTHONPATH=. python$* test/test_lsb_release.py -vv PYTHONPATH=. python$* test/test_initdutils.py -vv override_dh_python2: diff --git a/test/apt-cache b/test/apt-cache new file mode 100755 index 0000000..f6cc88f --- /dev/null +++ b/test/apt-cache @@ -0,0 +1,15 @@ +#!/usr/bin/python + +# Fake apt-cache python script to emulate policy output for test usage + +# Python3-compatible print() function +from __future__ import print_function + +import sys + +if len(sys.argv) <= 1 or sys.argv[1] != 'policy': + sys.exit("Shall only be run with exactly one argument: 'policy'") + +print("Package files:") +print(" 100 /var/lib/dpkg/status") +print(" release a=now") -- 2.30.2