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": "" }, )
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})