mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-15 14:11:50 +03:00
docs(python): fix example in mock
docs (#28894)
This commit is contained in:
parent
28875fa608
commit
88d7ff97a1
@ -135,7 +135,7 @@ test('gets the json from api and adds a new fruit', async ({ page }) => {
|
|||||||
```python async
|
```python async
|
||||||
async def test_gets_the_json_from_api_and_adds_a_new_fruit(page: Page):
|
async def test_gets_the_json_from_api_and_adds_a_new_fruit(page: Page):
|
||||||
async def handle(route: Route):
|
async def handle(route: Route):
|
||||||
response = await route.fulfill()
|
response = await route.fetch()
|
||||||
json = await response.json()
|
json = await response.json()
|
||||||
json.append({ "name": "Playwright", "id": 100})
|
json.append({ "name": "Playwright", "id": 100})
|
||||||
# Fulfill using the original response, while patching the response body
|
# Fulfill using the original response, while patching the response body
|
||||||
@ -154,7 +154,7 @@ async def test_gets_the_json_from_api_and_adds_a_new_fruit(page: Page):
|
|||||||
```python sync
|
```python sync
|
||||||
def test_gets_the_json_from_api_and_adds_a_new_fruit(page: Page):
|
def test_gets_the_json_from_api_and_adds_a_new_fruit(page: Page):
|
||||||
def handle(route: Route):
|
def handle(route: Route):
|
||||||
response = route.fulfill()
|
response = route.fetch()
|
||||||
json = response.json()
|
json = response.json()
|
||||||
json.append({ "name": "Playwright", "id": 100})
|
json.append({ "name": "Playwright", "id": 100})
|
||||||
# Fulfill using the original response, while patching the response body
|
# Fulfill using the original response, while patching the response body
|
||||||
|
Loading…
Reference in New Issue
Block a user