Skip to content

Tests failing #14

Description

@rwood-97

Hi,

I am getting the following errors when running tests:

(guardian) ➜  theguardian-api-python git:(master) python test.py  
./Users/rwood/miniconda3/envs/guardian/lib/python3.11/site-packages/urllib3/util/ssl_.py:260: DeprecationWarning: ssl.PROTOCOL_TLS is deprecated
  context = SSLContext(ssl_version or PROTOCOL_TLS)
/Users/rwood/miniconda3/envs/guardian/lib/python3.11/site-packages/urllib3/connection.py:407: DeprecationWarning: ssl.match_hostname() is deprecated
  match_hostname(cert, asserted_hostname)
F..........F...F....F..F.....F..F..
======================================================================
FAIL: test_content_response_failure_incorrect_api_key (test_content.TestContent.test_content_response_failure_incorrect_api_key)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/rwood/guardian_api/theguardian-api-python/tests/test_content.py", line 26, in test_content_response_failure_incorrect_api_key
    self.assertEqual(res.status_code, 403)
AssertionError: 401 != 403

======================================================================
FAIL: test_edition_get_indirect_content_invalid_credentials (test_edition.TestEdition.test_edition_get_indirect_content_invalid_credentials)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/rwood/guardian_api/theguardian-api-python/tests/test_edition.py", line 53, in test_edition_get_indirect_content_invalid_credentials
    self.assertEqual(res.status_code, 403)
AssertionError: 401 != 403

======================================================================
FAIL: test_edition_response_failure_incorrect_api_key (test_edition.TestEdition.test_edition_response_failure_incorrect_api_key)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/rwood/guardian_api/theguardian-api-python/tests/test_edition.py", line 27, in test_edition_response_failure_incorrect_api_key
    self.assertEqual(res.status_code, 403)
AssertionError: 401 != 403

======================================================================
FAIL: test_section_get_indirect_content_invalid_credentials (test_section.TestSection.test_section_get_indirect_content_invalid_credentials)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/rwood/guardian_api/theguardian-api-python/tests/test_section.py", line 54, in test_section_get_indirect_content_invalid_credentials
    self.assertEqual(res.status_code, 403)
AssertionError: 401 != 403

======================================================================
FAIL: test_section_response_failure_incorrect_api_key (test_section.TestSection.test_section_response_failure_incorrect_api_key)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/rwood/guardian_api/theguardian-api-python/tests/test_section.py", line 28, in test_section_response_failure_incorrect_api_key
    self.assertEqual(res.status_code, 403)
AssertionError: 401 != 403

======================================================================
FAIL: test_tag_get_indirect_content_invalid_credentials (test_tag.TestTag.test_tag_get_indirect_content_invalid_credentials)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/rwood/guardian_api/theguardian-api-python/tests/test_tag.py", line 53, in test_tag_get_indirect_content_invalid_credentials
    self.assertEqual(res.status_code, 403)
AssertionError: 401 != 403

======================================================================
FAIL: test_tag_response_failure_incorrect_api_key (test_tag.TestTag.test_tag_response_failure_incorrect_api_key)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/rwood/guardian_api/theguardian-api-python/tests/test_tag.py", line 27, in test_tag_response_failure_incorrect_api_key
    self.assertEqual(res.status_code, 403)
AssertionError: 401 != 403

----------------------------------------------------------------------
Ran 36 tests in 4.522s

FAILED (failures=7)

I am using conda and python version 3.11.0.
Here is my pip list:

Package    Version
---------- ---------
certifi    2022.12.7
chardet    3.0.4
idna       2.8
pip        23.0.1
requests   2.22.0
setuptools 67.6.0
urllib3    1.25.11
wheel      0.40.0

Thanks in advance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions