Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EventData().requestDict() takes no arguments #1

Open
Arussil opened this issue Feb 18, 2021 · 2 comments
Open

EventData().requestDict() takes no arguments #1

Arussil opened this issue Feb 18, 2021 · 2 comments

Comments

@Arussil
Copy link

Arussil commented Feb 18, 2021

Hello,

I found a problem with addContactExtEvent():

def addContactExtEvent(self, eventData):    
        if not isinstance(eventData, self.EventData):
            raise TypeError('addContactExtEvent accepts only SalesManagoEventData instances')
    
        request = self._generate_request(eventData, 'addContactExtEvent')
        response = self._requestsSession.send(
            request,
            timeout=self.API_REQUEST_DEFAULT_TIMEOUT
        )
    
        logger.debug(json.dumps({
            'action': 'addContactExtEvent',
            'request_body': request.body,
            'response_status': response.status_code,
            'response_json': response.json(),
>           'eventData': eventData.requestDict('addContactExtEvent')
        }))
E       TypeError: requestDict() takes 1 positional argument but 2 were given

/usr/local/lib/python3.7/site-packages/salesmanago_python_api/services/event.py:154: TypeError

I wrote some tests for my integration of your code and found this only when testing a real call to Salesmanago API, the mocked call (same as in your tests) always pass.

At the moment I'm forking this repo to make the required changes so my implementation can work (removing the unused paramenter), if all goes well i could then make a PR but I would like to know if there's some reason that something is passed to requestDict and if it's better to simple add the argument.

Thanks,

@haloween
Copy link
Owner

Hi there,
sorry for late reply. Sure thing, PR's are welcome.

@Darbados
Copy link

Hi there, sorry for late reply. Sure thing, PR's are welcome.

Hey man, can you grant acceess for opening PRs's?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants