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

Account blocked after running tests #918

Closed
DougCal opened this issue Jul 1, 2020 · 3 comments
Closed

Account blocked after running tests #918

DougCal opened this issue Jul 1, 2020 · 3 comments
Labels
type: question question directed at the library

Comments

@DougCal
Copy link
Contributor

DougCal commented Jul 1, 2020

Issue Summary

Made a contribution recently, but when I tried to run the tests, I get python_http_client.exceptions.UnauthorizedError: HTTP Error 401: UNAUTHORIZED several times. This happened to me on two free accounts. Still new, so it's possible I might've did something wrong. I attempted to contact support a few times about this and unlocking my account, but haven't gotten any response and it's been over a week.

Steps to Reproduce

  1. Create new free SendGrid account
  2. Run python -m pip install -r requirements.txt
  3. Run python -m unittest discover -v

Exception/Log

There's 231 failing out of the 305 tests, so I'll show one example

======================================================================
ERROR: test_whitelabel_links_subuser_get (test.test_sendgrid.UnitTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/johncalhoun/Documents/Projects/sendgrid-python/test/test_sendgrid.py", line 2248, in test_whitelabel_links_subuser_get
    query_params=params, request_headers=headers)
  File "/usr/local/lib/python3.7/site-packages/python_http_client/client.py", line 262, in http_request
    self._make_request(opener, request, timeout=timeout)
  File "/usr/local/lib/python3.7/site-packages/python_http_client/client.py", line 178, in _make_request
    raise exc
python_http_client.exceptions.UnauthorizedError: HTTP Error 401: UNAUTHORIZED

Technical details:

  • sendgrid-python version: commit 3415520
  • python version: 3.7.7
@childish-sambino
Copy link
Contributor

The integration tests attempt to hit the real SendGrid API endpoint. You can use Docker to mock/proxy this instead. Run all tests using make test-docker

@childish-sambino childish-sambino added status: waiting for feedback waiting for feedback from the submitter type: question question directed at the library and removed status: waiting for feedback waiting for feedback from the submitter labels Jul 1, 2020
@DougCal
Copy link
Contributor Author

DougCal commented Jul 1, 2020

@childish-sambino This worked really well. Was able to manually make tests fail and everything. Was looking around and this doesn't seem to be in any of the docs. Would it be useful to add this to TROUBLESHOOTING.md or docker-test/README.md?

@childish-sambino
Copy link
Contributor

Absolutely! Updated :91f4cd8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question question directed at the library
Projects
None yet
Development

No branches or pull requests

2 participants