def test_update_conf_file_raise(self, mock_hana): ''' Test update_conf_file method - raise ''' mock_hana.update_conf_file.side_effect = IOError('hana error') with pytest.raises(exceptions.CommandExecutionError) as err: hanamod.update_conf_file('hana.conf', sid='sid', number='00') mock_hana.update_conf_file.assert_called_once_with('hana.conf', sid='sid', number='00') assert 'hana error' in str(err)
def test_update_conf_file_return(self, mock_hana): ''' Test update_conf_file method - return ''' mock_hana.update_conf_file.return_value = 'hana.conf' conf_file = hanamod.update_conf_file('hana.conf', sid='sid', number='00') assert u'hana.conf' == conf_file mock_hana.update_conf_file.assert_called_once_with('hana.conf', sid='sid', number='00')