コード例 #1
0
 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')
コード例 #2
0
ファイル: debconfmod_test.py プロジェクト: DaveQB/salt
 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')
コード例 #3
0
 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",
             )