def test_server(): server = Server("valid_token", connect=False) assert type(server) == Server # The server eqs to a string, either the token or workspace domain assert server == "valid_token" assert server != "invalid_token"
def test_server_connect(rtm_start_fixture): with responses.RequestsMock() as rsps: rsps.add(responses.POST, "https://slack.com/api/rtm.start", status=200, json=rtm_start_fixture) Server(token="token", connect=True) for call in rsps.calls: assert call.request.url in ["https://slack.com/api/rtm.start"]
def server(monkeypatch): my_server = Server(token='xoxp-1234123412341234-12341234-1234', connect=False) return my_server
def server(monkeypatch): my_server = Server('xoxp-1234123412341234-12341234-1234', False) return my_server