diff options
| author | Julian Andres Klode <jak@debian.org> | 2010-12-12 14:26:26 +0100 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2010-12-12 14:26:26 +0100 |
| commit | 88cbcaa5a0fcffd319004b85287f0de42f622571 (patch) | |
| tree | 05db30be0c16f1b58c3ff8f1e4b2dd8a5d3c3eb7 /tests/test_apt_cache.py | |
| parent | eca74f2d3cdfc32ac9c8daeb50bba70da8590d91 (diff) | |
| parent | 6a05a8302c405c4c8d1b59f6be8c2d0974c6ce1e (diff) | |
| download | python-apt-88cbcaa5a0fcffd319004b85287f0de42f622571.tar.gz | |
Merge from mvo
* python/generic.h:
- set Object to NULL in CppDeallocPtr
* python/depcache.cc:
- don't run "actiongroup.release()" if the object was already
deallocated
* tests/test_apt_cache.py:
- fix tests to work if apt compressed indexes are enabled
Diffstat (limited to 'tests/test_apt_cache.py')
| -rw-r--r-- | tests/test_apt_cache.py | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/tests/test_apt_cache.py b/tests/test_apt_cache.py index efa73a4f..0b33a2e3 100644 --- a/tests/test_apt_cache.py +++ b/tests/test_apt_cache.py @@ -18,6 +18,7 @@ sys.path.insert(0, get_library_dir()) import apt import apt_pkg import shutil +import glob class TestAptCache(unittest.TestCase): """ test the apt cache """ @@ -139,12 +140,11 @@ class TestAptCache(unittest.TestCase): cache = apt.Cache() cache.update(sources_list=sources_list) # verify we just got the excpected package file - needle_packages = [f for f in os.listdir(lists_dir) - if f.endswith("tests_data_test-repo_Packages")] + needle_packages = glob.glob( + lists_dir+"/*tests_data_test-repo_Packages*") self.assertEqual(len(needle_packages), 1) # verify that we *only* got the Packages file from a single source - all_packages = [f for f in os.listdir(lists_dir) - if f.endswith("_Packages")] + all_packages = glob.glob(lists_dir+"/*_Packages*") self.assertEqual(needle_packages, all_packages) # verify that the listcleaner was not run and the marker file is # still there @@ -153,18 +153,15 @@ class TestAptCache(unittest.TestCase): # now run update again (without the "normal" sources.list that # contains test-repo2 and verify that we got the normal sources.list cache.update() - needle_packages = [f for f in os.listdir(lists_dir) - if f.endswith("tests_data_test-repo2_Packages")] + needle_packages = glob.glob(lists_dir+"/*tests_data_test-repo2_Packages*") self.assertEqual(len(needle_packages), 1) - all_packages = [f for f in os.listdir(lists_dir) - if f.endswith("_Packages")] + all_packages = glob.glob(lists_dir+"/*_Packages*") self.assertEqual(needle_packages, all_packages) # and another update with a single source only cache = apt.Cache() cache.update(sources_list=sources_list) - all_packages = [f for f in os.listdir(lists_dir) - if f.endswith("_Packages")] + all_packages = glob.glob(lists_dir+"/*_Packages*") self.assertEqual(len(all_packages), 2) if __name__ == "__main__": |
