def test_set_template(self): ''' Test for Set answers to debconf questions from a template. ''' mock = MagicMock(return_value='A') with patch.dict(debconfmod.__salt__, {'cp.get_template': mock}): with patch.object(debconfmod, 'set_file', mock): self.assertEqual( debconfmod.set_template('path', 'template', 'context', 'defaults', 'saltenv'), 'A')
def test_set_template(self): ''' Test for Set answers to debconf questions from a template. ''' mock = MagicMock(return_value='A') with patch.dict(debconfmod.__salt__, {'cp.get_template': mock}): with patch.object(debconfmod, 'set_file', mock): self.assertEqual(debconfmod.set_template('path', 'template', 'context', 'defaults', 'saltenv'), 'A')
def test_set_template(self): """ Test for Set answers to debconf questions from a template. """ mock = MagicMock(return_value="A") with patch.dict(debconfmod.__salt__, {"cp.get_template": mock}): with patch.object(debconfmod, "set_file", mock): self.assertEqual( debconfmod.set_template("path", "template", "context", "defaults", "saltenv"), "A", )