Commit c097bf20 authored by Gabriel Monnerat's avatar Gabriel Monnerat

coding style

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk/utils@43710 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 11deccde
...@@ -28,8 +28,7 @@ ...@@ -28,8 +28,7 @@
import unittest import unittest
import logging import logging
from cloudooo.utils.utils import logger, configureLogger, \ from cloudooo.utils import utils
convertStringToBool, loadMimetypeList
from cloudooo.handler.tests.handlerTestCase import make_suite from cloudooo.handler.tests.handlerTestCase import make_suite
import mimetypes import mimetypes
...@@ -39,27 +38,27 @@ class TestUtils(unittest.TestCase): ...@@ -39,27 +38,27 @@ class TestUtils(unittest.TestCase):
def testLog(self): def testLog(self):
"""Instanciate Log and test __call__ called function log""" """Instanciate Log and test __call__ called function log"""
configureLogger(logging.DEBUG) utils.configureLogger(logging.DEBUG)
logger.info("Test Log") utils.logger.info("Test Log")
logger.debug("Test Log") utils.logger.debug("Test Log")
configureLogger(logging.INFO) utils.configureLogger(logging.INFO)
logger.info("Test Log") utils.logger.info("Test Log")
logger.debug("Test Log") utils.logger.debug("Test Log")
def testConversion(self): def testConversion(self):
"""Test convertion to bool""" """Test convertion to bool"""
self.assertTrue(convertStringToBool('true')) self.assertTrue(utils.convertStringToBool('true'))
self.assertEquals(convertStringToBool('false'), False) self.assertEquals(utils.convertStringToBool('false'), False)
self.assertTrue(convertStringToBool('truE')) self.assertTrue(utils.convertStringToBool('truE'))
self.assertEquals(convertStringToBool('faLse'), False) self.assertEquals(utils.convertStringToBool('faLse'), False)
self.assertEquals(convertStringToBool(''), None) self.assertEquals(utils.convertStringToBool(''), None)
def testLoadMimetypelist(self): def testLoadMimetypelist(self):
"""Test if the file with mimetypes is loaded correctly""" """Test if the file with mimetypes is loaded correctly"""
self.assertEquals(mimetypes.types_map.get(".ogv"), None) self.assertEquals(mimetypes.types_map.get(".ogv"), None)
self.assertEquals(mimetypes.types_map.get(".3gp"), None) self.assertEquals(mimetypes.types_map.get(".3gp"), None)
loadMimetypeList() utils.loadMimetypeList()
self.assertEquals(mimetypes.types_map.get(".ogv"), "application/ogv") self.assertEquals(mimetypes.types_map.get(".ogv"), "video/ogg")
self.assertEquals(mimetypes.types_map.get(".3gp"), "video/3gpp") self.assertEquals(mimetypes.types_map.get(".3gp"), "video/3gpp")
......
...@@ -55,8 +55,8 @@ def run(handler_name): ...@@ -55,8 +55,8 @@ def run(handler_name):
'%s%s' % (test_name, python_extension))): '%s%s' % (test_name, python_extension))):
exit("%s not exists\n" % test_name) exit("%s not exists\n" % test_name)
from cloudooo.handler.tests.handlerTestCase import startFakeEnvironment, \ from cloudooo.handler.tests.handlerTestCase import startFakeEnvironment
stopFakeEnvironment from cloudooo.handler.tests.handlerTestCase import stopFakeEnvironment
sys.path.append(environment_path) sys.path.append(environment_path)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment