Beispiel #1
0
def test_unregister_handle_function():
    server = BaseServer(HOST, PORT)
    server.register_handle_function("helloworld", helloworld)
    assert server.handle_functions["helloworld"]() == "hello"

    server.unregister_handle_function("helloworld")
    assert server.handle_functions.has_key("helloworld") == False

    server.unregister_handle_function("helloworld") # this should not raise exception
Beispiel #2
0
def test_unregister_handle_function():
    server = BaseServer(HOST, PORT)
    server.register_handle_function("helloworld", helloworld)
    assert server.handle_functions["helloworld"]() == "hello"

    server.unregister_handle_function("helloworld")
    assert server.handle_functions.has_key("helloworld") == False

    server.unregister_handle_function(
        "helloworld")  # this should not raise exception