Skip to content

Fix tests to adapt to new batch API interface#3

Merged
MaxiOtero6 merged 3 commits into
mainfrom
copilot/fix-tests-new-api-interface
Nov 2, 2025
Merged

Fix tests to adapt to new batch API interface#3
MaxiOtero6 merged 3 commits into
mainfrom
copilot/fix-tests-new-api-interface

Conversation

Copilot AI commented Nov 2, 2025

Copy link
Copy Markdown
Contributor

Tests were failing after the API interface changed from single hash to batch workId/hashes model.

Changes

Request model:

  • hash (string) → workId (string) + hashes (list)

Response badges:

  • TRUSTEDMATCHS WITH DESCRIPTION
  • UNTRUSTEDNEEDS REVISION
  • UNKNOWN (unchanged)

Database schema:

  • Primary key: hashid (stores workId)

Test Updates

  • test_models.py: Updated request/response validation tests for new field names and badge literals
  • test_controllers.py: Updated endpoint tests with new request format and badge assertions
  • test_database.py: Changed cache operations from hash to id field, updated test data IDs to avoid conflicts
  • test_middleware.py: Updated validation error tests to check for new required fields

Example:

# Before
client.post("/gemini", json={"hash": "abc123", "expected": "..."})

# After
client.post("/gemini", json={
    "workId": "gig-0-1-1",
    "hashes": ["ipfs://abc123"],
    "expected": "..."
})

All 31 tests passing.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • cloudflare-ipfs.com
    • Triggering command: /home/REDACTED/.cache/pypoetry/virtualenvs/gemini-api-backend-F7Dmh1Cm-py3.12/bin/python /home/REDACTED/.cache/pypoetry/virtualenvs/gemini-api-backend-F7Dmh1Cm-py3.12/bin/pytest -v (dns block)
    • Triggering command: /home/REDACTED/.cache/pypoetry/virtualenvs/gemini-api-backend-F7Dmh1Cm-py3.12/bin/python /home/REDACTED/.cache/pypoetry/virtualenvs/gemini-api-backend-F7Dmh1Cm-py3.12/bin/pytest --tb=short -v (dns block)
  • dweb.link
    • Triggering command: /home/REDACTED/.cache/pypoetry/virtualenvs/gemini-api-backend-F7Dmh1Cm-py3.12/bin/python /home/REDACTED/.cache/pypoetry/virtualenvs/gemini-api-backend-F7Dmh1Cm-py3.12/bin/pytest -v (dns block)
    • Triggering command: /home/REDACTED/.cache/pypoetry/virtualenvs/gemini-api-backend-F7Dmh1Cm-py3.12/bin/python /home/REDACTED/.cache/pypoetry/virtualenvs/gemini-api-backend-F7Dmh1Cm-py3.12/bin/pytest --tb=short -v (dns block)
  • gateway.pinata.cloud
    • Triggering command: /home/REDACTED/.cache/pypoetry/virtualenvs/gemini-api-backend-F7Dmh1Cm-py3.12/bin/python /home/REDACTED/.cache/pypoetry/virtualenvs/gemini-api-backend-F7Dmh1Cm-py3.12/bin/pytest -v (dns block)
    • Triggering command: /home/REDACTED/.cache/pypoetry/virtualenvs/gemini-api-backend-F7Dmh1Cm-py3.12/bin/python /home/REDACTED/.cache/pypoetry/virtualenvs/gemini-api-backend-F7Dmh1Cm-py3.12/bin/pytest --tb=short -v (dns block)
  • ipfs.io
    • Triggering command: /home/REDACTED/.cache/pypoetry/virtualenvs/gemini-api-backend-F7Dmh1Cm-py3.12/bin/python /home/REDACTED/.cache/pypoetry/virtualenvs/gemini-api-backend-F7Dmh1Cm-py3.12/bin/pytest -v (dns block)
    • Triggering command: /home/REDACTED/.cache/pypoetry/virtualenvs/gemini-api-backend-F7Dmh1Cm-py3.12/bin/python /home/REDACTED/.cache/pypoetry/virtualenvs/gemini-api-backend-F7Dmh1Cm-py3.12/bin/pytest --tb=short -v (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

fix tests to addapt it to the new api interface

Created from VS Code via the GitHub Pull Request extension.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits November 2, 2025 23:39
… new badge values

Co-authored-by: MaxiOtero6 <106620067+MaxiOtero6@users.noreply.github.com>
Co-authored-by: MaxiOtero6 <106620067+MaxiOtero6@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix tests to adapt to the new API interface Fix tests to adapt to new batch API interface Nov 2, 2025
Copilot AI requested a review from MaxiOtero6 November 2, 2025 23:44
@MaxiOtero6
MaxiOtero6 marked this pull request as ready for review November 2, 2025 23:45
@MaxiOtero6
MaxiOtero6 merged commit 306de69 into main Nov 2, 2025
@MaxiOtero6
MaxiOtero6 deleted the copilot/fix-tests-new-api-interface branch November 2, 2025 23:45
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

Successfully merging this pull request may close these issues.

2 participants