Fix pylint warnings in test_testcase_base 87/31787/2
authorCédric Ollivier <cedric.ollivier@orange.com>
Sun, 26 Mar 2017 10:08:32 +0000 (12:08 +0200)
committerCédric Ollivier <cedric.ollivier@orange.com>
Sun, 26 Mar 2017 12:01:40 +0000 (14:01 +0200)
It takes into account the following warnings:
  - wrong-import-order
  - no-value-for-parameter

The 'no-value-for-parameter' warnings are false positive. The added
default values are useless but avoid them.

Change-Id: I50d0af178d9da668a3c72e75f5af467d36ca0e6a
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
functest/tests/unit/core/test_testcase_base.py

index b7c81d8..182da6e 100644 (file)
@@ -8,9 +8,10 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 
 import logging
-import mock
 import unittest
 
+import mock
+
 from functest.core import testcase_base
 
 
@@ -33,7 +34,7 @@ class TestcaseBaseTesting(unittest.TestCase):
 
     @mock.patch('functest.utils.functest_utils.push_results_to_db',
                 return_value=False)
-    def _test_missing_attribute(self, mock_function):
+    def _test_missing_attribute(self, mock_function=None):
         self.assertEqual(self.test.push_to_db(),
                          testcase_base.TestcaseBase.EX_PUSH_TO_DB_ERROR)
         mock_function.assert_not_called()
@@ -56,7 +57,7 @@ class TestcaseBaseTesting(unittest.TestCase):
 
     @mock.patch('functest.utils.functest_utils.push_results_to_db',
                 return_value=True)
-    def test_missing_details(self, mock_function):
+    def test_missing_details(self, mock_function=None):
         self.test.details = None
         self.assertEqual(self.test.push_to_db(),
                          testcase_base.TestcaseBase.EX_OK)
@@ -66,7 +67,7 @@ class TestcaseBaseTesting(unittest.TestCase):
 
     @mock.patch('functest.utils.functest_utils.push_results_to_db',
                 return_value=False)
-    def test_push_to_db_failed(self, mock_function):
+    def test_push_to_db_failed(self, mock_function=None):
         self.assertEqual(self.test.push_to_db(),
                          testcase_base.TestcaseBase.EX_PUSH_TO_DB_ERROR)
         mock_function.assert_called_once_with(
@@ -75,7 +76,7 @@ class TestcaseBaseTesting(unittest.TestCase):
 
     @mock.patch('functest.utils.functest_utils.push_results_to_db',
                 return_value=True)
-    def test_push_to_db(self, mock_function):
+    def test_push_to_db(self, mock_function=None):
         self.assertEqual(self.test.push_to_db(),
                          testcase_base.TestcaseBase.EX_OK)
         mock_function.assert_called_once_with(