[unittest] add entropy.qa UT
This commit is contained in:
34
libraries/tests/qa.py
Normal file
34
libraries/tests/qa.py
Normal 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()
|
||||
@@ -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:
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user