* really fix sourcedb tests (forgot to commit)

* comment
This commit is contained in:
Eray Özkural
2006-04-09 18:54:41 +00:00
parent d2d3f0acd5
commit d5a4654a8c
2 changed files with 9 additions and 10 deletions
+1 -1
View File
@@ -256,7 +256,7 @@ def info_name(package_name, installed=False):
metadata.package = package
#FIXME: get it from sourcedb if available
metadata.source = None
#TODO: fetch the files from server if possible (wow, you maniac -- exa)
#TODO: fetch the files from server if possible (wow, you maniac -- future exa)
if installed and ctx.installdb.is_installed(package.name):
files = ctx.installdb.files(package.name)
else:
+8 -9
View File
@@ -26,14 +26,13 @@ class SourceDBTestCase(testcase.TestCase):
self.sourcedb = pisi.sourcedb.init()
self.spec = SpecFile()
self.spec.read("tests/popt/pspec.xml")
def testAdd(self):
self.sourcedb.add_source(self.spec.source)
self.assert_(self.sourcedb.has_source("popt"))
def testRemove(self):
self.testAdd()
self.sourcedb.remove_source("popt")
self.assert_(not self.sourcedb.has_source("popt"))
if not ctx.repodb.has_repo('test'):
ctx.repodb.add_repo('test', pisi.repodb.Repo(pisi.uri.URI('fakerepo.xml')) )
def testAddRemove(self):
self.sourcedb.add_spec(self.spec, 'test')
self.assert_(self.sourcedb.has_spec("popt"))
self.sourcedb.remove_spec("popt", 'test')
self.assert_(not self.sourcedb.has_spec("popt"))
suite = unittest.makeSuite(SourceDBTestCase)