* really fix sourcedb tests (forgot to commit)
* comment
This commit is contained in:
+1
-1
@@ -256,7 +256,7 @@ def info_name(package_name, installed=False):
|
|||||||
metadata.package = package
|
metadata.package = package
|
||||||
#FIXME: get it from sourcedb if available
|
#FIXME: get it from sourcedb if available
|
||||||
metadata.source = None
|
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):
|
if installed and ctx.installdb.is_installed(package.name):
|
||||||
files = ctx.installdb.files(package.name)
|
files = ctx.installdb.files(package.name)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -26,14 +26,13 @@ class SourceDBTestCase(testcase.TestCase):
|
|||||||
self.sourcedb = pisi.sourcedb.init()
|
self.sourcedb = pisi.sourcedb.init()
|
||||||
self.spec = SpecFile()
|
self.spec = SpecFile()
|
||||||
self.spec.read("tests/popt/pspec.xml")
|
self.spec.read("tests/popt/pspec.xml")
|
||||||
|
if not ctx.repodb.has_repo('test'):
|
||||||
def testAdd(self):
|
ctx.repodb.add_repo('test', pisi.repodb.Repo(pisi.uri.URI('fakerepo.xml')) )
|
||||||
self.sourcedb.add_source(self.spec.source)
|
|
||||||
self.assert_(self.sourcedb.has_source("popt"))
|
def testAddRemove(self):
|
||||||
|
self.sourcedb.add_spec(self.spec, 'test')
|
||||||
def testRemove(self):
|
self.assert_(self.sourcedb.has_spec("popt"))
|
||||||
self.testAdd()
|
self.sourcedb.remove_spec("popt", 'test')
|
||||||
self.sourcedb.remove_source("popt")
|
self.assert_(not self.sourcedb.has_spec("popt"))
|
||||||
self.assert_(not self.sourcedb.has_source("popt"))
|
|
||||||
|
|
||||||
suite = unittest.makeSuite(SourceDBTestCase)
|
suite = unittest.makeSuite(SourceDBTestCase)
|
||||||
|
|||||||
Reference in New Issue
Block a user