예제 #1
0
 def _test_service() -> SimpleService:
     config = ServiceConfiguration()
     config.uris = ["https://dummy/simple/api"]
     service = RequestsClient.create(SimpleService,
                                     user_agent="pytest",
                                     service_config=config)
     return service
def test_repr_service():
    config = ServiceConfiguration()
    config.uris = ["http://one/", "http://two/"]
    service = RequestsClient.create(Service, "user-agent", config)
    assert (
        repr(service) ==
        "Service(requests_session=requests.Session(...), uris=['http://one/', 'http://two/'])"
    )
def config(server):
    config = ServiceConfiguration()
    config.uris = ["http://localhost:{port}/".format(port=server.server_port)]
    return config
예제 #4
0
def config():
    config = ServiceConfiguration()
    config.uris = ["http://localhost:8000"]
    return config