Esempio n. 1
0
 def test_setvalue_io_error(self):
     '''
     Test if it set a value for a specific augeas path
     '''
     mock = MagicMock(side_effect=IOError(''))
     with patch.object(_Augeas, 'save', mock):
         self.assertEqual(augeas_cfg.setvalue('prefix=/files/etc/'),
                          {'retval': False, 'error': ''})
Esempio n. 2
0
 def test_setvalue_io_error(self):
     '''
     Test if it set a value for a specific augeas path
     '''
     mock = MagicMock(side_effect=IOError(''))
     with patch.object(_Augeas, 'save', mock):
         self.assertEqual(augeas_cfg.setvalue('prefix=/files/etc/'),
                          {'retval': False, 'error': ''})
Esempio n. 3
0
 def test_setvalue_io_error(self):
     """
     Test if it set a value for a specific augeas path
     """
     mock = MagicMock(side_effect=IOError(""))
     with patch.object(_Augeas, "save", mock):
         self.assertEqual(
             augeas_cfg.setvalue("prefix=/files/etc/"),
             {
                 "retval": False,
                 "error": ""
             },
         )
Esempio n. 4
0
 def test_setvalue(self):
     '''
     Test if it set a value for a specific augeas path
     '''
     self.assertEqual(augeas_cfg.setvalue('prefix=/etc/hosts'),
                      {'retval': True})
Esempio n. 5
0
 def test_setvalue(self):
     """
     Test if it set a value for a specific augeas path
     """
     self.assertEqual(augeas_cfg.setvalue("prefix=/etc/hosts"),
                      {"retval": True})
Esempio n. 6
0
 def test_setvalue(self):
     '''
     Test if it set a value for a specific augeas path
     '''
     self.assertEqual(augeas_cfg.setvalue('prefix=/etc/hosts'),
                      {'retval': True})