diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2021-11-10 15:42:57 +0100 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2021-11-15 09:27:07 +0100 |
commit | 4fdbdd34fb5fea55571a18b2438ececa953928ff (patch) | |
tree | 44f1d6ff38cedad25b058ba18844e1004b7385db /functest/tests/unit/openstack/vping/test_vping_ssh.py | |
parent | e25e576af33547657c278e2dae49b033bf6a1fa1 (diff) |
Update linters and fix all new issues
It mostly add encoding in open calls and leverage f-strings.
Change-Id: Ifead18fc724a452c1067dcf91dc577032edc9c59
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/tests/unit/openstack/vping/test_vping_ssh.py')
-rw-r--r-- | functest/tests/unit/openstack/vping/test_vping_ssh.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/functest/tests/unit/openstack/vping/test_vping_ssh.py b/functest/tests/unit/openstack/vping/test_vping_ssh.py index bc1148da4..a07148aab 100644 --- a/functest/tests/unit/openstack/vping/test_vping_ssh.py +++ b/functest/tests/unit/openstack/vping/test_vping_ssh.py @@ -47,7 +47,7 @@ class VpingSSHTesting(unittest.TestCase): self.vping.prepare() args[0].assert_called_once_with() args[1].assert_called_once_with( - '{}-vm2_{}'.format(self.vping.case_name, self.vping.guid), + f'{self.vping.case_name}-vm2_{self.vping.guid}', security_groups=[self.vping.sec.id]) @mock.patch('functest.opnfv_tests.openstack.vping.vping_ssh.VPingSSH.' @@ -58,7 +58,7 @@ class VpingSSHTesting(unittest.TestCase): self.vping.prepare() args[0].assert_called_once_with() args[1].assert_called_once_with( - '{}-vm2_{}'.format(self.vping.case_name, self.vping.guid), + f'{self.vping.case_name}-vm2_{self.vping.guid}', security_groups=[self.vping.sec.id]) @mock.patch('functest.opnfv_tests.openstack.vping.vping_ssh.VPingSSH.' @@ -70,7 +70,7 @@ class VpingSSHTesting(unittest.TestCase): with self.assertRaises(ssh_exception.SSHException): self.vping.execute() self.vping.ssh.exec_command.assert_called_once_with( - 'ping -c 1 {}'.format(self.vping.vm2.private_v4)) + f'ping -c 1 {self.vping.vm2.private_v4}') args[0].assert_called_once_with('foo') @mock.patch('functest.opnfv_tests.openstack.vping.vping_ssh.VPingSSH.' @@ -94,7 +94,7 @@ class VpingSSHTesting(unittest.TestCase): self.assertEqual(self.vping.execute(), ret) mock_check.assert_called_once_with('foo') self.vping.ssh.exec_command.assert_called_once_with( - 'ping -c 1 {}'.format(self.vping.vm2.private_v4)) + f'ping -c 1 {self.vping.vm2.private_v4}') def test_execute1(self): self._test_execute() |