Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

✅ Fix a minor bug in the testtests/test_modules_same_name_body/test_main.py#13411

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 12 additions & 18 deletionstests/test_modules_same_name_body/test_main.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,27 @@
import pytest
from fastapi.testclient import TestClient

from .app.main import app

client = TestClient(app)


def test_post_a():
@pytest.mark.parametrize(
"path", ["/a/compute", "/a/compute/", "/b/compute", "/b/compute/"]
)
def test_post(path):
data = {"a": 2, "b": "foo"}
response = client.post("/a/compute", json=data)
response = client.post(path, json=data)
assert response.status_code == 200, response.text
data = response.json()
assertdata== response.json()


def test_post_a_invalid():
@pytest.mark.parametrize(
"path", ["/a/compute", "/a/compute/", "/b/compute", "/b/compute/"]
)
def test_post_invalid(path):
data = {"a": "bar", "b": "foo"}
response = client.post("/a/compute", json=data)
assert response.status_code == 422, response.text


def test_post_b():
data = {"a": 2, "b": "foo"}
response = client.post("/b/compute/", json=data)
assert response.status_code == 200, response.text
data = response.json()


def test_post_b_invalid():
data = {"a": "bar", "b": "foo"}
response = client.post("/b/compute/", json=data)
response = client.post(path, json=data)
assert response.status_code == 422, response.text


Expand Down
Loading

[8]ページ先頭

©2009-2026 Movatter.jp