Exemplo n.º 1
0
    def test_call_with_no_args_or_kwargs(self, date_service, router):
        client = Client(router=router)
        with client:
            response = client.call("get_todays_date")

        today = date.today()

        assert response == today.isoformat()
Exemplo n.º 2
0
    def test_call_with_no_args_or_kwargs(self, date_service, router):
        client = Client(url=router.url)
        with client:
            response = client.call("get_todays_date")

        today = date.today()

        assert response == today.isoformat()
def main():
    port = config('PORT')
    url = f'ws://*****:*****@example.com', 'blebs')
    if isinstance(x, Error):
        print('Error:', x.message)
    else:
        print(x)

    x = client.call('authenticate', '*****@*****.**', 'blebs')
    if isinstance(x, Error):
        print('Error:', x.message)
    else:
        print(x)

    client.stop()
Exemplo n.º 4
0
    def test_call_with_args_and_kwargs(self, hello_service, router):
        caller = Client(router=router)
        with caller:
            response = caller.call("say_greeting", "Simon", greeting="watcha")

        assert response == "watcha to Simon"
Exemplo n.º 5
0
    def test_call_with_args_but_no_kwargs(self, hello_service, router):
        caller = Client(router=router)
        with caller:
            response = caller.call("say_hello", "Simon")

        assert response == "Hello Simon"
Exemplo n.º 6
0
    def test_call_with_args_and_kwargs(self, hello_service, router):
        caller = Client(url=router.url)
        with caller:
            response = caller.call("say_greeting", "Simon", greeting="watcha")

        assert response == "watcha to Simon"
Exemplo n.º 7
0
    def test_call_with_args_but_no_kwargs(self, hello_service, router):
        caller = Client(url=router.url)
        with caller:
            response = caller.call("say_hello", "Simon")

        assert response == "Hello Simon"