示例#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': ''})
示例#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': ''})
 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": ""
             },
         )
示例#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})
 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})
示例#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})