From 05d6f9a7d4d2b5dcf7c680661bcd4119ad4acc0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Metin?= Date: Fri, 24 Jun 2005 10:29:44 +0000 Subject: [PATCH] =?UTF-8?q?Constants=20i=C3=A7erisindeki=20de=C4=9Ferleri?= =?UTF-8?q?=20de=20test=20et.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Testleri biraz daha sıkı hale getiriyorum. Bu sayede daha önce yakalayamadığımız bugları (varsa ;) yalakarız belki. --- tests/constantstests.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/constantstests.py b/tests/constantstests.py index e6c7e73a..406812f7 100644 --- a/tests/constantstests.py +++ b/tests/constantstests.py @@ -35,4 +35,20 @@ class ContextTestCase(unittest.TestCase): # we achived our goal with this error. infact, this is a # ConstError but we can't catch it directly here pass + + def testConstValues(self): + constDict = { + "actions_file": "actions.py", + "setup_func": "setup", + "lib_dir_suffix": "/var/lib/pisi", + "metadata_xml": "metadata.xml" + } + + for k in constDict.keys(): + if hasattr(const, k): + value = getattr(const, k) + self.assertEqual(value, constDict[k]) + else: + self.fail("Constants does not have an attribute named %s" % k) + suite = unittest.makeSuite(ContextTestCase)