diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/apt-test.py | 2 | ||||
| -rw-r--r-- | tests/cache.py | 2 | ||||
| -rw-r--r-- | tests/depcache.py | 4 | ||||
| -rw-r--r-- | tests/lock.py | 6 | ||||
| -rwxr-xr-x | tests/memleak.py | 4 | ||||
| -rw-r--r-- | tests/pkgproblemresolver.py | 2 | ||||
| -rw-r--r-- | tests/pkgrecords.py | 4 | ||||
| -rw-r--r-- | tests/pkgsrcrecords.py | 2 | ||||
| -rwxr-xr-x | tests/refcount.py | 2 | ||||
| -rw-r--r-- | tests/test_aptsources.py | 18 |
10 files changed, 23 insertions, 23 deletions
diff --git a/tests/apt-test.py b/tests/apt-test.py index 6205cf60..fac2ff43 100644 --- a/tests/apt-test.py +++ b/tests/apt-test.py @@ -20,7 +20,7 @@ if __name__ == "__main__": cache = apt.Cache(progress) for name in cache.keys(): import random - if random.randint(0,1) == 1: + if random.randint(0, 1) == 1: cache[name].markDelete() print "Broken: %s " % cache._depcache.BrokenCount print "DelCount: %s " % cache._depcache.DelCount diff --git a/tests/cache.py b/tests/cache.py index 24732578..4e79eb3e 100644 --- a/tests/cache.py +++ b/tests/cache.py @@ -43,7 +43,7 @@ def main(): j = ver.DependsList pass - print "\r%i/%i=%.3f%% " % (i,all,(float(i)/float(all)*100)), + print "\r%i/%i=%.3f%% " % (i, all, (float(i) / float(all) * 100)), if __name__ == "__main__": diff --git a/tests/depcache.py b/tests/depcache.py index 32c510f0..5ed54895 100644 --- a/tests/depcache.py +++ b/tests/depcache.py @@ -31,8 +31,8 @@ def main(): if depcache.MarkedInstall(p): depcache.MarkKeep(p) if depcache.InstCount != 0: - print "Error undoing the selection for %s (InstCount: %s)" % (x,depcache.InstCount) - print "\r%i/%i=%.3f%% " % (i,all,(float(i)/float(all)*100)), + print "Error undoing the selection for %s (InstCount: %s)" % (x, depcache.InstCount) + print "\r%i/%i=%.3f%% " % (i, all, (float(i) / float(all) * 100)), print print "Trying Upgrade:" diff --git a/tests/lock.py b/tests/lock.py index aeab804b..8bd5619f 100644 --- a/tests/lock.py +++ b/tests/lock.py @@ -26,14 +26,14 @@ if __name__ == "__main__": apt_pkg.PkgSystemUnLock() # low-level lock - fd = apt_pkg.GetLock(lock,True) + fd = apt_pkg.GetLock(lock, True) print "Lockfile fd: %s" % fd # try to get lock without error flag pid = os.fork() if pid == 0: # child - fd = apt_pkg.GetLock(lock,False) + fd = apt_pkg.GetLock(lock, False) print "Lockfile fd (child): %s" % fd sys.exit(0) @@ -41,6 +41,6 @@ if __name__ == "__main__": pid = os.fork() if pid == 0: # child - fd = apt_pkg.GetLock(lock,True) + fd = apt_pkg.GetLock(lock, True) print "Lockfile fd (child): %s" % fd sys.exit(0) diff --git a/tests/memleak.py b/tests/memleak.py index 6eece9d4..659091fc 100755 --- a/tests/memleak.py +++ b/tests/memleak.py @@ -15,7 +15,7 @@ for i in range(100): print cache["apt"].name time.sleep(1) gc.collect() - f = open("%s" % i,"w") + f = open("%s" % i, "w") for obj in gc.get_objects(): f.write("%s\n" % str(obj)) f.close() @@ -37,7 +37,7 @@ for i in range(100): dict = {} for pkg in cache.Packages: if len(pkg.VersionList) > 0: - dict[pkg.Name] = apt.Package(cache,depcache, + dict[pkg.Name] = apt.Package(cache, depcache, records, list, None, pkg) print cache["apt"] diff --git a/tests/pkgproblemresolver.py b/tests/pkgproblemresolver.py index 82186d40..7d5ae682 100644 --- a/tests/pkgproblemresolver.py +++ b/tests/pkgproblemresolver.py @@ -49,7 +49,7 @@ def main(): depcache.MarkKeep(p) if depcache.InstCount != 0: print "Error undoing the selection for %s" % x - print "\r%i/%i=%.3f%% " % (i,all,(float(i)/float(all)*100)), + print "\r%i/%i=%.3f%% " % (i, all, (float(i) / float(all) * 100)), print print "Trying Upgrade:" diff --git a/tests/pkgrecords.py b/tests/pkgrecords.py index 72096463..e128237b 100644 --- a/tests/pkgrecords.py +++ b/tests/pkgrecords.py @@ -25,12 +25,12 @@ def main(): if not version: continue file, index = version.FileList.pop(0) - if records.Lookup((file,index)): + if records.Lookup((file, index)): #print records.FileName x = records.FileName y = records.LongDesc pass - print "\r%i/%i=%.3f%% " % (i,cache.PackageCount, (float(i)/float(cache.PackageCount)*100)), + print "\r%i/%i=%.3f%% " % (i, cache.PackageCount, (float(i) / float(cache.PackageCount) * 100)), if __name__ == "__main__": diff --git a/tests/pkgsrcrecords.py b/tests/pkgsrcrecords.py index 3eb0fcab..6e78858b 100644 --- a/tests/pkgsrcrecords.py +++ b/tests/pkgsrcrecords.py @@ -19,7 +19,7 @@ def main(): if src.Lookup(x.Name): #print src.Package pass - print "\r%i/%i=%.3f%% " % (i,cache.PackageCount, (float(i)/float(cache.PackageCount)*100)), + print "\r%i/%i=%.3f%% " % (i, cache.PackageCount, (float(i) / float(cache.PackageCount) * 100)), if __name__ == "__main__": diff --git a/tests/refcount.py b/tests/refcount.py index f3230bd3..a29744ae 100755 --- a/tests/refcount.py +++ b/tests/refcount.py @@ -1,6 +1,6 @@ #!/usr/bin/python-dbg -from pprint import pprint,pformat +from pprint import pprint, pformat import apt import sys import gc diff --git a/tests/test_aptsources.py b/tests/test_aptsources.py index 08c8194a..9019aa2d 100644 --- a/tests/test_aptsources.py +++ b/tests/test_aptsources.py @@ -13,7 +13,7 @@ class TestAptSources(unittest.TestCase): unittest.TestCase.__init__(self, methodName) apt_pkg.init() apt_pkg.Config.Set("Dir::Etc", os.getcwd()) - apt_pkg.Config.Set("Dir::Etc::sourceparts",".") + apt_pkg.Config.Set("Dir::Etc::sourceparts", ".") def testIsMirror(self): self.assertTrue(aptsources.is_mirror("http://archive.ubuntu.com", @@ -22,7 +22,7 @@ class TestAptSources(unittest.TestCase): "http://ftp.debian.org")) def testSourcesListReading(self): - apt_pkg.Config.Set("Dir::Etc::sourcelist","data/sources.list") + apt_pkg.Config.Set("Dir::Etc::sourcelist", "data/sources.list") sources = aptsources.SourcesList() self.assertEqual(len(sources.list), 6) # test load @@ -31,22 +31,22 @@ class TestAptSources(unittest.TestCase): self.assertEqual(len(sources.list), 6) def testSourcesListAdding(self): - apt_pkg.Config.Set("Dir::Etc::sourcelist","data/sources.list") + apt_pkg.Config.Set("Dir::Etc::sourcelist", "data/sources.list") sources = aptsources.SourcesList() # test to add something that is already there (main) before = copy.deepcopy(sources) - sources.add("deb","http://de.archive.ubuntu.com/ubuntu/", + sources.add("deb", "http://de.archive.ubuntu.com/ubuntu/", "edgy", ["main"]) self.assertTrue(sources.list == before.list) # test to add something that is already there (restricted) before = copy.deepcopy(sources) - sources.add("deb","http://de.archive.ubuntu.com/ubuntu/", + sources.add("deb", "http://de.archive.ubuntu.com/ubuntu/", "edgy", ["restricted"]) self.assertTrue(sources.list == before.list) # test to add something new: multiverse - sources.add("deb","http://de.archive.ubuntu.com/ubuntu/", + sources.add("deb", "http://de.archive.ubuntu.com/ubuntu/", "edgy", ["multiverse"]) found = False @@ -60,7 +60,7 @@ class TestAptSources(unittest.TestCase): # test to add something new: multiverse *and* # something that is already there before = copy.deepcopy(sources) - sources.add("deb","http://de.archive.ubuntu.com/ubuntu/", + sources.add("deb", "http://de.archive.ubuntu.com/ubuntu/", "edgy", ["universe", "something"]) found_universe = 0 @@ -79,7 +79,7 @@ class TestAptSources(unittest.TestCase): self.assertEqual(found_universe, 1) def testDistribution(self): - apt_pkg.Config.Set("Dir::Etc::sourcelist","data/sources.list.testDistribution") + apt_pkg.Config.Set("Dir::Etc::sourcelist", "data/sources.list.testDistribution") sources = aptsources.SourcesList() distro = aptsources.Distribution() distro.get_sources(sources) @@ -89,7 +89,7 @@ class TestAptSources(unittest.TestCase): if s.template: dist_templates.add(s.template.name) #print dist_templates - for d in ["edgy","edgy-security","edgy-updates","hoary","breezy", "breezy-backports"]: + for d in ["edgy", "edgy-security", "edgy-updates", "hoary", "breezy", "breezy-backports"]: self.assertTrue(d in dist_templates) # test enable comp = "restricted" |
