Skip to content

JSONDecodeError in test_context_schema due to HTML response instead of JSON #139

@zacdezgeo

Description

@zacdezgeo

Description

I noticed @vincentsarago mentioned failing tests unrelated to his PR in #136.

While setting up a development environment for stac-pydantic and running tests using tox, I encountered failures in the main branch related to test_context_schema functions in test_context.py. These failures seem to be caused by the tests receiving an HTML page instead of the expected JSON schema from a remote URL, leading to JSONDecodeError.

Steps to Reproduce

  1. Clone the repository: git clone https://github.com/stac-utils/stac-pydantic.git
  2. Navigate to the project directory: cd stac-pydantic
  3. Install dependencies:
    • pip install pre-commit
    • pre-commit install
    • pip install tox
  4. Run tests: tox

Expected Behavior

I expected all tests to pass, particularly those fetching a JSON schema from a specified remote URL.

Actual Behavior

The test test_context_schema fails with a JSONDecodeError because they received an HTML response instead of the expected JSON content. This suggests that the URL might need to be corrected or updated.

Error Log

For full error details, refer to the tox log output concerning the test_context_schema function.

After gathering feedback, I'm open to suggestions and will look into submitting a PR to address this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions