Example #1
0
def test_pop_context(pop_server: POPServer):
    assert pop_server.is_login() is False
    with pop_server as server:
        assert isinstance(server, POPServer)
        assert server.server is not None
        assert server.is_login() is True and server._login is True
    assert server.server is None
    assert server.is_login() is False and server._login is False
Example #2
0
def test_pop_logout(pop_server_config):
    srv = POPServer(**pop_server_config)
    srv.login()
    srv.logout()
    assert srv.is_login() is False and srv._login is False
Example #3
0
def test_pop_duplicate_login(pop_server_config):
    srv = POPServer(**pop_server_config)
    srv.login()
    srv.login()
    assert srv.is_login() is True and srv._login is True
    srv.logout()