diff --git a/pisi/api.py b/pisi/api.py index 2f4e679b..7d7ab0ba 100644 --- a/pisi/api.py +++ b/pisi/api.py @@ -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: diff --git a/tests/sourcedbtests.py b/tests/sourcedbtests.py index f11fac67..7a14c186 100644 --- a/tests/sourcedbtests.py +++ b/tests/sourcedbtests.py @@ -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)