Exemple #1
0
 def test_remove(self):
     '''
     Test if it removes for path expression
     '''
     self.assertEqual(augeas_cfg.remove('/etc/service'), {
         'count': 0,
         'retval': True
     })
Exemple #2
0
 def test_remove_io_runtime_error(self):
     '''
     Test if it removes for path expression
     '''
     mock = MagicMock(side_effect=RuntimeError('error'))
     with patch.object(_Augeas, 'save', mock):
         self.assertEqual(augeas_cfg.remove('/etc/service-name'),
                          {'count': 0, 'error': 'error', 'retval': False})
 def test_remove(self):
     """
     Test if it removes for path expression
     """
     self.assertEqual(augeas_cfg.remove("/etc/service"), {
         "count": 0,
         "retval": True
     })
Exemple #4
0
 def test_remove_io_runtime_error(self):
     '''
     Test if it removes for path expression
     '''
     mock = MagicMock(side_effect=RuntimeError('error'))
     with patch.object(_Augeas, 'save', mock):
         self.assertEqual(augeas_cfg.remove('/etc/service-name'),
                          {'count': 0, 'error': 'error', 'retval': False})
 def test_remove_io_runtime_error(self):
     """
     Test if it removes for path expression
     """
     mock = MagicMock(side_effect=RuntimeError("error"))
     with patch.object(_Augeas, "save", mock):
         self.assertEqual(
             augeas_cfg.remove("/etc/service-name"),
             {
                 "count": 0,
                 "error": "error",
                 "retval": False
             },
         )
Exemple #6
0
 def test_remove(self):
     '''
     Test if it removes for path expression
     '''
     self.assertEqual(augeas_cfg.remove('/etc/service'),
                      {'count': 0, 'retval': True})