예제 #1
0
def test_say_hello():
    client = Client(base_url='https://test.com', verify=False, auth=('test', 'test'))
    args = {
        'name': 'Dbot'
    }
    _, outputs, _ = say_hello_command(client, args)

    assert outputs['hello'] == 'Hello Dbot'
예제 #2
0
def test_say_hello():
    """Tests helloworld-say-hello command function.

    Checks the output of the command function with the expected output.

    No mock is needed here because the say_hello_command does not call
    any external API.
    """
    from HelloWorld import Client, say_hello_command

    client = Client(base_url='https://test.com/api/v1', verify=False, auth=('test', 'test'))
    args = {
        'name': 'Dbot'
    }
    response = say_hello_command(client, args)

    assert response.outputs == 'Hello Dbot'