Example #1
0
    def test_failure_pattern(self):
        authorization = SingleTeamAuthorization(auth_test_result={})
        req = BoltRequest(body="payload={}", headers={})
        req.context["client"] = WebClient(
            base_url=self.mock_api_server_base_url, token="dummy"
        )
        resp = BoltResponse(status=404)

        resp = authorization.process(req=req, resp=resp, next=next)

        assert resp.status == 200
        assert resp.body == ":x: Please install this app into the workspace :bow:"
Example #2
0
    def test_success_pattern(self):
        authorization = SingleTeamAuthorization(auth_test_result={})
        req = BoltRequest(body="payload={}", headers={})
        req.context["client"] = WebClient(
            base_url=self.mock_api_server_base_url, token="xoxb-valid"
        )
        resp = BoltResponse(status=404)

        resp = authorization.process(req=req, resp=resp, next=next)

        assert resp.status == 200
        assert resp.body == ""