mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
commit
1e9214f4e4
1 changed files with 8 additions and 4 deletions
|
@ -145,21 +145,25 @@ class IptablesTestCase(TestCase):
|
|||
|
||||
# 'get_saved_rules' function tests: 1
|
||||
|
||||
@patch('salt.modules.iptables._parse_conf', MagicMock(return_value=False))
|
||||
def test_get_saved_rules(self):
|
||||
'''
|
||||
Test if it return a data structure of the rules in the conf file
|
||||
'''
|
||||
self.assertFalse(iptables.get_saved_rules())
|
||||
mock = MagicMock(return_value=False)
|
||||
with patch.object(iptables, '_parse_conf', mock):
|
||||
self.assertFalse(iptables.get_saved_rules())
|
||||
mock.assert_called_with(conf_file=None, family='ipv4')
|
||||
|
||||
# 'get_rules' function tests: 1
|
||||
|
||||
@patch('salt.modules.iptables._parse_conf', MagicMock(return_value=False))
|
||||
def test_get_rules(self):
|
||||
'''
|
||||
Test if it return a data structure of the current, in-memory rules
|
||||
'''
|
||||
self.assertFalse(iptables.get_rules())
|
||||
mock = MagicMock(return_value=False)
|
||||
with patch.object(iptables, '_parse_conf', mock):
|
||||
self.assertFalse(iptables.get_rules())
|
||||
mock.assert_called_with(in_mem=True, family='ipv4')
|
||||
|
||||
# 'get_saved_policy' function tests: 1
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue