biraz daha sıkı testler.

This commit is contained in:
Barış Metin
2005-06-24 10:52:56 +00:00
parent 9b86a6e86f
commit c58a500ecc
+20 -12
View File
@@ -11,24 +11,32 @@ class SpecFileTestCase(unittest.TestCase):
self.spec = specfile.SpecFile()
self.spec.read("samples/popt/popt.pspec")
def testSourceName(self):
self.assertEqual(self.spec.source.name,
"popt")
def testReadSpec(self):
self.assertEqual(self.spec.source.name, "popt")
def testSourceVersion(self):
self.assertEqual(self.spec.source.version,
"1.7")
self.assertEqual(self.spec.source.version, "1.7")
def testSourceLastRelease(self):
self.assertEqual(self.spec.source.release,
"3")
self.assertEqual(self.spec.source.release, "3")
def testSHA1Sum(self):
self.assertEqual(self.spec.source.archiveSHA1,
"66f3c77b87a160951b180447f4a6dce68ad2f71b")
def testLenPackages(self):
self.assertEqual(len(self.spec.packages), 1)
patches = self.spec.source.patches
self.assertEqual(len(patches), 1)
patch = patches[0] #get first and the only patch
self.assertEqual(patch.filename, "popt-1.7-uclibc.patch.gz")
self.assertEqual(patch.compressionType, "gz")
packages = self.spec.packages
self.assertEqual(len(packages), 1)
package = packages[0] # get the first and the only package
self.assertEqual(package.name, "popt-libs")
# search for a path in package.paths
pn = "/usr/lib"
matched = [p for p in package.paths if p.pathname == pn]
if not matched:
self.fail("Failed to match pathname: %s" %pn)
def testCopy(self):
util.check_dir(config.tmp_dir())