diff options
| author | Julian Andres Klode <jak@debian.org> | 2009-07-23 15:09:08 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2009-07-23 15:09:08 +0200 |
| commit | 4ae2f454115f3ab758ef9bf0b1f31e5b04ac934a (patch) | |
| tree | 54e50e15d738bfb82d1f5c81eb44e36b17fb9ac6 | |
| parent | 544f14e0f2fb70b5a1f30786a93023a42d88290d (diff) | |
| download | python-apt-4ae2f454115f3ab758ef9bf0b1f31e5b04ac934a.tar.gz | |
tests: Prefix all docstring with the name of the file.
| -rw-r--r-- | tests/test_aptsources.py | 11 | ||||
| -rw-r--r-- | tests/test_aptsources_ports.py | 2 | ||||
| -rw-r--r-- | tests/test_cache_invocation.py | 4 | ||||
| -rw-r--r-- | tests/test_hashes.py | 20 |
4 files changed, 19 insertions, 18 deletions
diff --git a/tests/test_aptsources.py b/tests/test_aptsources.py index e5cd1f5a..0ae05bf3 100644 --- a/tests/test_aptsources.py +++ b/tests/test_aptsources.py @@ -18,7 +18,7 @@ class TestAptSources(unittest.TestCase): apt_pkg.config.set("Dir::Etc::sourceparts", "/xxx") def testIsMirror(self): - """Test mirror detection.""" + """aptsources: Test mirror detection.""" yes = aptsources.sourceslist.is_mirror("http://archive.ubuntu.com", "http://de.archive.ubuntu.com") no = aptsources.sourceslist.is_mirror("http://archive.ubuntu.com", @@ -27,7 +27,7 @@ class TestAptSources(unittest.TestCase): self.assertFalse(no) def testSourcesListReading(self): - """Test sources.list parsing.""" + """aptsources: Test sources.list parsing.""" apt_pkg.config.set("Dir::Etc::sourcelist", "data/aptsources/" "sources.list") sources = aptsources.sourceslist.SourcesList() @@ -38,7 +38,7 @@ class TestAptSources(unittest.TestCase): self.assertEqual(len(sources.list), 6) def testSourcesListAdding(self): - """Test additions to sources.list""" + """aptsources: Test additions to sources.list""" apt_pkg.config.set("Dir::Etc::sourcelist", "data/aptsources/" "sources.list") sources = aptsources.sourceslist.SourcesList() @@ -88,7 +88,7 @@ class TestAptSources(unittest.TestCase): self.assertEqual(found_universe, 1) def testMatcher(self): - """Test matcher (detection of what is what in sources.list)""" + """aptsources: Test matcher""" apt_pkg.config.set("Dir::Etc::sourcelist", "data/aptsources/" "sources.list.testDistribution") sources = aptsources.sourceslist.SourcesList() @@ -101,7 +101,7 @@ class TestAptSources(unittest.TestCase): self.fail("source entry '%s' has no matcher" % s) def testDistribution(self): - """Test distribution detection.""" + """aptsources: Test distribution detection.""" apt_pkg.config.set("Dir::Etc::sourcelist", "data/aptsources/" "sources.list.testDistribution") sources = aptsources.sourceslist.SourcesList() @@ -152,4 +152,5 @@ class TestAptSources(unittest.TestCase): if __name__ == "__main__": + os.chdir(os.path.dirname(__file__)) unittest.main() diff --git a/tests/test_aptsources_ports.py b/tests/test_aptsources_ports.py index 5594ec0b..f837585b 100644 --- a/tests/test_aptsources_ports.py +++ b/tests/test_aptsources_ports.py @@ -20,7 +20,7 @@ class TestAptSourcesPorts(unittest.TestCase): apt_pkg.config.set("Dir::Etc::sourceparts", "/xxx") def testMatcher(self): - """Test matcher.""" + """aptsources_ports: Test matcher.""" apt_pkg.config.set("Dir::Etc::sourcelist", "sources.list") sources = aptsources.sourceslist.SourcesList() distro = aptsources.distro.get_distro("Ubuntu", "hardy", "desc", diff --git a/tests/test_cache_invocation.py b/tests/test_cache_invocation.py index 39dae8f4..ff86b102 100644 --- a/tests/test_cache_invocation.py +++ b/tests/test_cache_invocation.py @@ -12,7 +12,7 @@ class TestCache(unittest.TestCase): apt_pkg.init_system() def test_wrong_invocation(self): - """Test wrong invocation of apt_pkg.Cache(apt_pkg.Cache())""" + """cache_invocation: Test wrong invocation.""" apt_cache = apt_pkg.Cache(apt_pkg.OpProgress()) if apt_pkg._COMPAT_0_7: self.assertRaises(ValueError, apt_pkg.Cache, apt_cache) @@ -26,7 +26,7 @@ class TestCache(unittest.TestCase): self.assertRaises(TypeError, apt_pkg.Cache, 0) def test_proper_invocation(self): - """Test correct invocation of apt_pkg.DepCache(apt_pkg.Cache()).""" + """cache_invocation: Test correct invocation.""" apt_cache = apt_pkg.Cache(apt_pkg.OpProgress()) apt_depcache = apt_pkg.DepCache(apt_cache) diff --git a/tests/test_hashes.py b/tests/test_hashes.py index 520c4925..e0aabe09 100644 --- a/tests/test_hashes.py +++ b/tests/test_hashes.py @@ -37,34 +37,34 @@ class TestHashes(unittest.TestCase): self.file.close() def test_md5sum(self): - """Test apt_pkg.md5sum()""" + """hashes: Test apt_pkg.md5sum()""" self.assertEqual(apt_pkg.md5sum(self.value), self.md5) self.assertEqual(apt_pkg.md5sum(self.file), self.md5) def test_sha1sum(self): - """Test apt_pkg.sha1sum()""" + """hashes: Test apt_pkg.sha1sum()""" self.assertEqual(apt_pkg.sha1sum(self.value), self.sha1) self.assertEqual(apt_pkg.sha1sum(self.file), self.sha1) def test_sha256sum(self): - """Test apt_pkg.sha256sum()""" + """hashes: Test apt_pkg.sha256sum()""" self.assertEqual(apt_pkg.sha256sum(self.value), self.sha256) self.assertEqual(apt_pkg.sha256sum(self.file), self.sha256) def test_bytes(self): - """Test apt_pkg.Hashes(bytes)""" + """hashes: Test apt_pkg.Hashes(bytes)""" self.assertEqual(self.hashes.md5, self.md5) self.assertEqual(self.hashes.sha1, self.sha1) self.assertEqual(self.hashes.sha256, self.sha256) def test_file(self): - """Test apt_pkg.Hashes(file).""" + """hashes: Test apt_pkg.Hashes(file).""" self.assertEqual(self.hashes.md5, self.fhashes.md5) self.assertEqual(self.hashes.sha1, self.fhashes.sha1) self.assertEqual(self.hashes.sha256, self.fhashes.sha256) def test_unicode(self): - """Test apt_pkg.Hashes(unicode).""" + """hashes: Test apt_pkg.Hashes(unicode).""" if sys.version_info[0] == 3: self.assertRaises(TypeError, apt_pkg.Hashes, "D") self.assertRaises(TypeError, apt_pkg.md5sum, "D") @@ -88,22 +88,22 @@ class TestHashString(unittest.TestCase): self.sha256 = apt_pkg.HashString("SHA256", self.hashes.sha256) def test_md5(self): - """Test apt_pkg.HashString().md5""" + """hashes: Test apt_pkg.HashString().md5""" self.assertEqual("MD5Sum:%s" % self.hashes.md5, str(self.md5)) self.assertTrue(self.md5.verify_file(apt_pkg.__file__)) def test_sha1(self): - """Test apt_pkg.HashString().sha1""" + """hashes: Test apt_pkg.HashString().sha1""" self.assertEqual("SHA1:%s" % self.hashes.sha1, str(self.sha1)) self.assertTrue(self.sha1.verify_file(apt_pkg.__file__)) def test_sha256(self): - """Test apt_pkg.HashString().sha256""" + """hashes: Test apt_pkg.HashString().sha256""" self.assertEqual("SHA256:%s" % self.hashes.sha256, str(self.sha256)) self.assertTrue(self.sha256.verify_file(apt_pkg.__file__)) def test_wrong(self): - """Test wrong invocation of HashString.""" + """hashes: Test apt_pkg.HashString(wrong_type).""" self.assertRaises(TypeError, apt_pkg.HashString, 0) if sys.version_info[0] == 3: self.assertRaises(TypeError, apt_pkg.HashString, bytes()) |
