aboutsummaryrefslogtreecommitdiffstats
path: root/xtesting/tests/unit/utils
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2021-11-09 11:22:02 +0100
committerCédric Ollivier <cedric.ollivier@orange.com>2021-11-09 13:21:47 +0100
commit17739d718901a10f7ec0aaf9a6d53141294a347d (patch)
treea98e6d09a42016ceec90713adac681918a4a9c62 /xtesting/tests/unit/utils
parent92681911699428a87ea56c0263832b96a93da3da (diff)
Leverage latest pylint features
It adds encoding in all open call and leverage f-strings. Change-Id: I70ccd2bfcadae44929d5874f98fa3bf4ff644488 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'xtesting/tests/unit/utils')
-rw-r--r--xtesting/tests/unit/utils/test_decorators.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/xtesting/tests/unit/utils/test_decorators.py b/xtesting/tests/unit/utils/test_decorators.py
index 2810df15..ae6ffa4b 100644
--- a/xtesting/tests/unit/utils/test_decorators.py
+++ b/xtesting/tests/unit/utils/test_decorators.py
@@ -24,8 +24,8 @@ from xtesting.utils import decorators
__author__ = "Cedric Ollivier <cedric.ollivier@orange.com>"
DIR = '/dev'
-FILE = '{}/null'.format(DIR)
-URL = 'file://{}'.format(FILE)
+FILE = f'{DIR}/null'
+URL = f'file://{FILE}'
class FakeTestCase(testcase.TestCase):
@@ -108,7 +108,7 @@ class DecoratorsTesting(unittest.TestCase):
create=True) as mock_open:
test = self._get_testcase()
self.assertEqual(test.push_to_db(), testcase.TestCase.EX_OK)
- mock_open.assert_called_once_with(FILE, 'a')
+ mock_open.assert_called_once_with(FILE, 'a', encoding='utf-8')
handle = mock_open()
call_args, _ = handle.write.call_args
self.assertIn('POST', call_args[0])