From d5d00561c4a0c9b093214a3cb98835d2cbab64ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eray=20=C3=96zkural?= Date: Mon, 27 Jun 2005 21:16:19 +0000 Subject: [PATCH] * start sourcedb tests --- tests/sourcedbtests.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/sourcedbtests.py diff --git a/tests/sourcedbtests.py b/tests/sourcedbtests.py new file mode 100644 index 00000000..548051c2 --- /dev/null +++ b/tests/sourcedbtests.py @@ -0,0 +1,23 @@ + +import unittest +import os + +from pisi import packagedb +from pisi import util +from pisi import context + +class SourceDBTestCase(unittest.TestCase): + + def setUp(self): + self.ctx = context.BuildContext("samples/popt/popt.pspec") + + def testAdd(self): + sourcedb.add_source("testsourcedb", self.ctx.spec.source) + self.assert_(sourcedb.has_package("testsourcedb")) + + def testRemove(self): + self.testAdd() + sourcedb.remove_package("testsourcedb") + self.assert_(not sourcedb.has_package("testsourcedb")) + +suite = unittest.makeSuite(SourceDBTestCase)