[unittest] add entropy.qa UT

This commit is contained in:
Fabio Erculiani
2009-10-11 00:58:13 +02:00
parent f3e8cff068
commit 90e992000f
3 changed files with 37 additions and 3 deletions

34
libraries/tests/qa.py Normal file
View File

@@ -0,0 +1,34 @@
# -*- coding: utf-8 -*-
import sys
sys.path.insert(0, '.')
sys.path.insert(0, '../')
import unittest
import entropy.qa
from entropy.output import TextInterface
import tests._misc as _misc
import tempfile
class QATest(unittest.TestCase):
def setUp(self):
text = TextInterface()
self.QA = entropy.qa.QAInterface(text)
def tearDown(self):
"""
tearDown is run after each test
"""
sys.stdout.write("%s ran\n" % (self,))
sys.stdout.flush()
def test_package_qa(self):
pkgs = [_misc.get_test_entropy_package4(),
_misc.get_test_entropy_package3(),
_misc.get_test_entropy_package2(),
_misc.get_test_entropy_package()
]
for pkg in pkgs:
self.assert_(self.QA.entropy_package_checks(pkg))
if __name__ == '__main__':
unittest.main()

View File

@@ -14,11 +14,11 @@ sys.path.insert(0,'../')
# set unit testing mode
from entropy.const import etpSys
etpSys['unittest'] = True
from tests import db, client, server, misc, transceivers, tools, i18n, spm
from tests import db, client, server, misc, transceivers, tools, i18n, spm, qa
rc = 0
# Add to the list the module to test
mods = [db, client, server, misc, transceivers, tools, i18n, spm]
mods = [db, client, server, misc, transceivers, tools, i18n, spm, qa]
tests = []
for mod in mods:

View File

@@ -10,7 +10,7 @@ import tests._misc as _misc
import tempfile
import shutil
class ToolsTest(unittest.TestCase):
class SpmTest(unittest.TestCase):
def setUp(self):
self.Client = Client(noclientdb = 2, indexing = False, xcache = False,