From f52dcef7ba5f2dac509df37329d2e0f015129189 Mon Sep 17 00:00:00 2001 From: Nathaniel Case Date: Tue, 6 Jun 2017 09:56:44 -0400 Subject: [PATCH] Actually check for equality on empty commands array (#25308) --- test/units/modules/network/eos/eos_module.py | 2 +- test/units/modules/network/eos/test_eos_eapi.py | 6 ++---- test/units/modules/network/ios/ios_module.py | 2 +- test/units/modules/network/iosxr/iosxr_module.py | 2 +- test/units/modules/network/nxos/nxos_module.py | 2 +- test/units/modules/network/ovs/ovs_module.py | 2 +- test/units/modules/network/vyos/vyos_module.py | 2 +- 7 files changed, 8 insertions(+), 10 deletions(-) diff --git a/test/units/modules/network/eos/eos_module.py b/test/units/modules/network/eos/eos_module.py index dcfe421547d..76ceafe08cc 100644 --- a/test/units/modules/network/eos/eos_module.py +++ b/test/units/modules/network/eos/eos_module.py @@ -75,7 +75,7 @@ class TestEosModule(unittest.TestCase): result = self.changed(changed) self.assertEqual(result['changed'], changed, result) - if commands: + if commands is not None: if sort: self.assertEqual(sorted(commands), sorted(result['commands']), result['commands']) else: diff --git a/test/units/modules/network/eos/test_eos_eapi.py b/test/units/modules/network/eos/test_eos_eapi.py index b7e7b8c9fd7..5ef9a3b14f2 100644 --- a/test/units/modules/network/eos/test_eos_eapi.py +++ b/test/units/modules/network/eos/test_eos_eapi.py @@ -95,8 +95,7 @@ class TestEosEapiModule(TestEosModule): def test_eos_eapi_http_invalid(self): set_module_args(dict(http_port=80000)) - commands = [] - self.start_unconfigured(failed=True, commands=commands) + self.start_unconfigured(failed=True) def test_eos_eapi_https_enable(self): set_module_args(dict(https=True)) @@ -137,8 +136,7 @@ class TestEosEapiModule(TestEosModule): def test_eos_eapi_vrf_missing(self): set_module_args(dict(vrf='missing')) - commands = [] - self.start_unconfigured(failed=True, commands=commands) + self.start_unconfigured(failed=True) def test_eos_eapi_state_absent(self): set_module_args(dict(state='stopped')) diff --git a/test/units/modules/network/ios/ios_module.py b/test/units/modules/network/ios/ios_module.py index 0c4dcd6513d..35d66587256 100644 --- a/test/units/modules/network/ios/ios_module.py +++ b/test/units/modules/network/ios/ios_module.py @@ -75,7 +75,7 @@ class TestIosModule(unittest.TestCase): result = self.changed(changed) self.assertEqual(result['changed'], changed, result) - if commands: + if commands is not None: if sort: self.assertEqual(sorted(commands), sorted(result['commands']), result['commands']) else: diff --git a/test/units/modules/network/iosxr/iosxr_module.py b/test/units/modules/network/iosxr/iosxr_module.py index ab205ba984a..e4ecf5884ab 100644 --- a/test/units/modules/network/iosxr/iosxr_module.py +++ b/test/units/modules/network/iosxr/iosxr_module.py @@ -75,7 +75,7 @@ class TestIosxrModule(unittest.TestCase): result = self.changed(changed) self.assertEqual(result['changed'], changed, result) - if commands: + if commands is not None: if sort: self.assertEqual(sorted(commands), sorted(result['commands']), result['commands']) else: diff --git a/test/units/modules/network/nxos/nxos_module.py b/test/units/modules/network/nxos/nxos_module.py index d83a0b831f3..53972c80c84 100644 --- a/test/units/modules/network/nxos/nxos_module.py +++ b/test/units/modules/network/nxos/nxos_module.py @@ -75,7 +75,7 @@ class TestNxosModule(unittest.TestCase): result = self.changed(changed) self.assertEqual(result['changed'], changed, result) - if commands: + if commands is not None: if sort: self.assertEqual(sorted(commands), sorted(result['commands']), result['commands']) else: diff --git a/test/units/modules/network/ovs/ovs_module.py b/test/units/modules/network/ovs/ovs_module.py index aa5ea2cf7c1..5360e7a8640 100644 --- a/test/units/modules/network/ovs/ovs_module.py +++ b/test/units/modules/network/ovs/ovs_module.py @@ -76,7 +76,7 @@ class TestOpenVSwitchModule(unittest.TestCase): result = self.changed(changed) self.assertEqual(result['changed'], changed, result) - if commands: + if commands is not None: self.assertEqual(commands, result['commands'], result['commands']) return result diff --git a/test/units/modules/network/vyos/vyos_module.py b/test/units/modules/network/vyos/vyos_module.py index 803c6441356..012f7e08f76 100644 --- a/test/units/modules/network/vyos/vyos_module.py +++ b/test/units/modules/network/vyos/vyos_module.py @@ -74,7 +74,7 @@ class TestVyosModule(unittest.TestCase): result = self.changed(changed) self.assertEqual(result['changed'], changed, result) - if commands: + if commands is not None: if sort: self.assertEqual(sorted(commands), sorted(result['commands']), result['commands']) else: