def test_it_returns_a_task_with_the_replaced_url(self): locust_request = LocustRequest( method=MagicMock(), url=MagicMock(), headers=MagicMock() ) task = Task( name="some name", request=MagicMock(), locust_request=locust_request ) expected_url = 'f"http://a.b.c/{some.value}/"' modified_task = Task.replace_url(task, expected_url) assert modified_task.locust_request.url == expected_url
def test_it_creates_a_locust_request_when_there_is_none(self): task = Task(name="some name", request=MagicMock()) modified_task = Task.replace_url(task, "") assert modified_task.locust_request