[Kimchi-devel] [PATCH][Kimchi] Fix test_model pep8 non-compliant syntax

Daniel Henrique Barboza dhbarboza82 at gmail.com
Thu Aug 18 14:35:50 UTC 2016


Applied to master. Thanks!

On 08/17/2016 04:21 PM, Ramon Medeiros wrote:
> Signed-off-by: Ramon Medeiros <ramonn at linux.vnet.ibm.com>
> ---
>   tests/test_model.py | 29 ++++++++++-------------------
>   1 file changed, 10 insertions(+), 19 deletions(-)
>
> diff --git a/tests/test_model.py b/tests/test_model.py
> index 27225f8..09821b1 100644
> --- a/tests/test_model.py
> +++ b/tests/test_model.py
> @@ -466,12 +466,9 @@ class ModelTests(unittest.TestCase):
>           self.assertEqual(fw_manager.opened_ports, {})
>   
>           mock_run_cmd.assert_has_calls(
> -            [
> -                 call(['firewall-cmd', '--state', '-q']),
> -                 call(['firewall-cmd', '--add-port=5905/tcp']),
> -                 call(['firewall-cmd', '--remove-port=5905/tcp'])
> -            ]
> -        )
> +            [call(['firewall-cmd', '--state', '-q']),
> +             call(['firewall-cmd', '--add-port=5905/tcp']),
> +             call(['firewall-cmd', '--remove-port=5905/tcp'])])
>   
>       @mock.patch('wok.plugins.kimchi.model.virtviewerfile.run_command')
>       def test_firewall_provider_ufw(self, mock_run_cmd):
> @@ -487,13 +484,10 @@ class ModelTests(unittest.TestCase):
>           self.assertEqual(fw_manager.opened_ports, {})
>   
>           mock_run_cmd.assert_has_calls(
> -            [
> -                 call(['firewall-cmd', '--state', '-q']),
> -                 call(['ufw', 'status']),
> -                 call(['ufw', 'allow', '5905/tcp']),
> -                 call(['ufw', 'deny', '5905/tcp'])
> -            ]
> -        )
> +            [call(['firewall-cmd', '--state', '-q']),
> +             call(['ufw', 'status']),
> +             call(['ufw', 'allow', '5905/tcp']),
> +             call(['ufw', 'deny', '5905/tcp'])])
>   
>       @mock.patch('wok.plugins.kimchi.model.virtviewerfile.run_command')
>       def test_firewall_provider_iptables(self, mock_run_cmd):
> @@ -515,12 +509,9 @@ class ModelTests(unittest.TestCase):
>                           5905, '-j', 'ACCEPT']
>   
>           mock_run_cmd.assert_has_calls(
> -            [
> -                 call(['firewall-cmd', '--state', '-q']),
> -                 call(['ufw', 'status']),
> -                 call(iptables_add), call(iptables_del)
> -            ]
> -        )
> +            [call(['firewall-cmd', '--state', '-q']),
> +             call(['ufw', 'status']),
> +             call(iptables_add), call(iptables_del)])
>   
>       @unittest.skipUnless(utils.running_as_root(), 'Must be run as root')
>       @mock.patch('wok.plugins.kimchi.model.virtviewerfile.'




More information about the Kimchi-devel mailing list