diff -r c7c26511138f -r 7c4a911dc066 buildframework/helium/sf/python/pythoncore/lib/pythoncoretests/test_integration_ant.py --- a/buildframework/helium/sf/python/pythoncore/lib/pythoncoretests/test_integration_ant.py Wed Jun 16 16:51:40 2010 +0300 +++ b/buildframework/helium/sf/python/pythoncore/lib/pythoncoretests/test_integration_ant.py Fri Aug 13 14:59:05 2010 +0300 @@ -18,7 +18,7 @@ #=============================================================================== """ Testing integration.ant module """ -# pylint: disable-msg=R0201 +# pylint: disable=R0201 import tempfile import os @@ -31,6 +31,7 @@ class IntegrationAntTest(unittest.TestCase): """Verifying integration ant module""" + def test_check_build_duplicates_task(self): """Verifying check_build_duplicates_task method """ (fileDes, outputFilename) = tempfile.mkstemp() @@ -41,12 +42,14 @@ outputFile.close() os.unlink(outputFilename) assert len(contents) == 15 + def test_check_build_duplicates_task_invalid(self): """Verifying check_build_duplicates_task (invalid args) method""" self.assertRaises(Exception, integration.ant.check_build_duplicates_task, None, None, None, None) class _emulateTask(): """Emulate task""" + def log(self, message): """Emulate log method""" pass @@ -55,39 +58,47 @@ """Emulate attributes""" def __init__(self, outputFilename): self.outputFilename = outputFilename + def get(self, _): """Emulate get method""" return self.outputFilename class _emulateElements(): """Emulate elements""" + def get(self, _): """Emulate get method""" return _emulateFileset() class _emulateFileset(): """Emulate fileset""" + def get(self, _): """Emulate get method""" return _emulateDirScanner() + def size(self): """Emulate size method""" return 1 class _emulateDirScanner(): """Emulate dirscanner""" + def scan(self): """Emulate scan method""" pass + def getIncludedFiles(self): """Emulate getIncludedFiles method """ if os.sep == '\\': return ['test_build_compile.log'] elif os.sep == '/': return ['test_build_compile_linux.log'] + def getDirectoryScanner(self, _): """Emulate getDirectoryScanner method """ return self + def getBasedir(self): """Emulate getBasedir method """ return os.path.join(os.environ['TEST_DATA'], 'data', 'compile', 'logs')