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

[BUG] test_func_wrapper - test_add_put returns 404 #17

Open
evelynmitchell opened this issue Dec 22, 2023 · 1 comment
Open

[BUG] test_func_wrapper - test_add_put returns 404 #17

evelynmitchell opened this issue Dec 22, 2023 · 1 comment
Assignees
Labels
bug Something isn't working Fund no-issue-activity

Comments

@evelynmitchell
Copy link
Contributor

evelynmitchell commented Dec 22, 2023

In a container, with pytest-benchmark installed, python 3.10.13

pytest test_func_wrapper.py 
================================= test session starts =================================
platform linux -- Python 3.10.13, pytest-7.4.3, pluggy-1.3.0
benchmark: 4.0.0 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /usr/src/swarm_cloud/tests
plugins: benchmark-4.0.0, time-machine-2.13.0, anyio-3.7.1
collected 17 items                                                                    

test_func_wrapper.py .FF..FFFFFFFFFFFF                                          [100%]

====================================== FAILURES =======================================
____________________________________ test_add_put _____________________________________

func_api_wrapper = <swarms_cloud.func_api_wrapper.SwarmCloud object at 0x7fa99c932ec0>

    def test_add_put(func_api_wrapper):
        @func_api_wrapper.add("/test_put", method="put")
        def test_put_endpoint():
            return {"message": "test_put"}
    
        client = TestClient(func_api_wrapper.app)
        response = client.put("/test_put")
>       assert response.status_code == 200
E       assert 404 == 200
E        +  where 404 = <Response [404 Not Found]>.status_code

test_func_wrapper.py:81: AssertionError
---------------------------------- Captured log call ----------------------------------
INFO     swarms_cloud.func_api_wrapper:func_api_wrapper.py:93 Error in test_put_endpoint: Invalid method: put

This means that the /test_put endpoint is not found when called with the method put.

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@evelynmitchell evelynmitchell added the bug Something isn't working label Dec 22, 2023
Copy link

Stale issue message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Fund no-issue-activity
Projects
None yet
Development

No branches or pull requests

2 participants