Closed Mantisus closed 1 week ago
Nice! One suggestion: the test_sending_payload
, test_sending_form_payload
, and test_sending_json_payload
functions share quite a lot of the same code. We could at least use the payload
as a fixture.
@pytest.fixture
def payload() -> dict[str, str]:
return {
'custname': 'John Doe',
'custtel': '1234567890',
'custemail': 'johndoe@example.com',
'size': 'large',
'topping': '["bacon", "cheese", "mushroom"]',
'delivery': '13:00',
'comments': 'Please ring the doorbell upon arrival.',
}
fix: adding tests for testing payload
Addings tests is not a fix. Looking at your code, this PR is not just adding tests. Pay more attention to the PR titles, they will end up in the changelog, so they need to make sense to our users. If its not something to include in changelog, don't use fix
commit type.
Nice! One suggestion: the
test_sending_payload
,test_sending_form_payload
, andtest_sending_json_payload
functions share quite a lot of the same code. We could at least use thepayload
as a fixture.@pytest.fixture def payload() -> dict[str, str]: return { 'custname': 'John Doe', 'custtel': '1234567890', 'custemail': 'johndoe@example.com', 'size': 'large', 'topping': '["bacon", "cheese", "mushroom"]', 'delivery': '13:00', 'comments': 'Please ring the doorbell upon arrival.', }
I'd say a fixture is overkill in this case, a top-level constant (PAYLOAD = {...}
) would work just as fine
Description
Correction of comments related to PR #683 Add new tests for
http_crawler
different forms ofpayload
Testing
The test checks that the
payload
on the client side matches the data received by the server. Also added verification that different types ofpayload
are correctly handled on the client side and correctly recognized by the server with appropriate headersChecklist