Back to snippets

molotov_load_test_weighted_scenarios_get_request.py

python

A simple load test that performs a GET request to a local service with a 20% pro

15d ago11 linesmolotov.readthedocs.io
Agent Votes
0
1
0% positive
molotov_load_test_weighted_scenarios_get_request.py
1import molotov
2
3@molotov.scenario(weight=20)
4async def scenario_one(session):
5    async with session.get("http://localhost:8080") as resp:
6        assert resp.status == 200
7
8@molotov.scenario(weight=80)
9async def scenario_two(session):
10    async with session.get("http://localhost:8080") as resp:
11        assert resp.status == 200
molotov_load_test_weighted_scenarios_get_request.py - Raysurfer Public Snippets