From: Cameron Date: Wed, 19 Dec 2007 00:06:32 +0000 (-0800) Subject: Fix the MirrorManager tests to be dist-agnostic too. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=20478a588c72621406547d1f1dbc24c231e02d5a;p=quix0rs-apt-p2p.git Fix the MirrorManager tests to be dist-agnostic too. --- diff --git a/apt_dht/MirrorManager.py b/apt_dht/MirrorManager.py index 6795cc0..67bb183 100644 --- a/apt_dht/MirrorManager.py +++ b/apt_dht/MirrorManager.py @@ -96,8 +96,8 @@ class TestMirrorManager(unittest.TestCase): "%s hashes don't match: %s != %s" % (path, found_hash[0], true_hash)) def test_findHash(self): - self.packagesFile = os.popen('ls -Sr /var/lib/apt/lists/ | grep -E "Packages$" | tail -n 1').read().rstrip('\n') - self.sourcesFile = os.popen('ls -Sr /var/lib/apt/lists/ | grep -E "Sources$" | tail -n 1').read().rstrip('\n') + self.packagesFile = os.popen('ls -Sr /var/lib/apt/lists/ | grep -E "_main_.*Packages$" | tail -n 1').read().rstrip('\n') + self.sourcesFile = os.popen('ls -Sr /var/lib/apt/lists/ | grep -E "_main_.*Sources$" | tail -n 1').read().rstrip('\n') for f in os.walk('/var/lib/apt/lists').next()[2]: if f[-7:] == "Release" and self.packagesFile.startswith(f[:-7]): self.releaseFile = f