mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix failing test now that we're raising a CommandExecutionError
Also adds a test to check that the CommandExecutionError is raised when the filename is not present.
This commit is contained in:
parent
c6a3476abb
commit
e082ff538b
1 changed files with 9 additions and 0 deletions
|
@ -16,6 +16,7 @@ from salttesting.mock import (
|
|||
)
|
||||
|
||||
# Import Salt Libs
|
||||
from salt.exceptions import CommandExecutionError
|
||||
from salt.modules import dnsmasq
|
||||
|
||||
# Import python libs
|
||||
|
@ -85,6 +86,14 @@ class DnsmasqTestCase(TestCase):
|
|||
with patch.object(os, 'listdir', mock):
|
||||
self.assertDictEqual(dnsmasq.get_config(), {'conf-dir': 'A'})
|
||||
|
||||
def test_parse_dnsmasq_no_file(self):
|
||||
'''
|
||||
Tests that a CommandExecutionError is when a filename that doesn't exist is
|
||||
passed in.
|
||||
'''
|
||||
self.assertRaises(CommandExecutionError, dnsmasq._parse_dnamasq, 'filename')
|
||||
|
||||
@patch('os.path.isfile', MagicMock(return_value=True))
|
||||
def test_parse_dnamasq(self):
|
||||
'''
|
||||
test for generic function for parsing dnsmasq files including includes.
|
||||
|
|
Loading…
Add table
Reference in a new issue