예제 #1
0
def test_client_status_msg_to_stdout(deserver):
    """Make sure the actual client console call goes to stdout"""
    import decisionengine.framework.engine.de_client as de_client

    myoutput = io.StringIO()
    sys.stdout = myoutput
    de_client.console_scripts_main(
        ["--host", deserver.server_address[0], "--port", str(deserver.server_address[1]), "--status"]
    )
    sys.stdout = sys.__stdout__
    assert "channel: test_channel" in myoutput.getvalue()
예제 #2
0
def test_client_err_returned_verbose_as_rc():
    """no de server is running, so --status should error"""
    msg = de_client.console_scripts_main(['--status', '--verbose'])
    assert 'An error occurred' in msg
예제 #3
0
def test_client_err_returned_as_rc():
    """no de server is running, so --status should error"""
    msg = de_client.console_scripts_main(["--status"])
    assert "An error occurred" in msg