class PackageDBTestCase(testcase.TestCase): def setUp(self): testcase.TestCase.setUp(self) self.spec = SpecFile() self.spec.read('tests/popt/pspec.xml') self.spec.check() def testAdd(self): if not ctx.repodb.has_repo('test'): ctx.repodb.add_repo('test', pisi.repodb.Repo(pisi.uri.URI('fakerepo.xml')) ) ctx.packagedb.add_package(self.spec.packages[1], 'test') self.assert_(ctx.packagedb.has_package('popt-libs')) # close the database and remove lock #self.pdb.close() def testRemove(self): ctx.packagedb.remove_package('popt-libs', 'test') self.assert_(not ctx.packagedb.has_package('popt-libs', 'test'))
class PackageDBTestCase(testcase.TestCase): def setUp(self): testcase.TestCase.setUp(self) self.spec = SpecFile() self.spec.read('tests/popt/pspec.xml') self.spec.check() def testAdd(self): if not ctx.repodb.has_repo('test'): ctx.repodb.add_repo('test', pisi.repodb.Repo(pisi.uri.URI('fakerepo.xml'))) ctx.packagedb.add_package(self.spec.packages[1], 'test') self.assert_(ctx.packagedb.has_package('popt-libs')) # close the database and remove lock #self.pdb.close() def testRemove(self): ctx.packagedb.remove_package('popt-libs', 'test') self.assert_(not ctx.packagedb.has_package('popt-libs', 'test'))