File: example10.py

package info (click to toggle)
python-molotov 2.7-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 8,264 kB
  • sloc: python: 4,121; makefile: 60
file content (16 lines) | stat: -rw-r--r-- 474 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"""

This Molotov script runs against a GRPC endpoint

"""
from molotov import scenario
from molotov.tests._grpc import helloworld_pb2, helloworld_pb2_grpc


@scenario(weight=40)
async def grpc_scenario(
    session, session_factory="grpc", grpc_url="ipv4:///127.0.0.1:50051"
):
    stub = helloworld_pb2_grpc.GreeterStub(session)
    response = await stub.SayHello(helloworld_pb2.HelloRequest(name="Alice"))
    assert response.message == "Hello, Alice!", response.message