Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test failure due to Chalice's breaking change #93

Closed
seratch opened this issue Sep 18, 2020 · 1 comment
Closed

Test failure due to Chalice's breaking change #93

seratch opened this issue Sep 18, 2020 · 1 comment

Comments

@seratch
Copy link
Member

seratch commented Sep 18, 2020

$ travis_retry pytest tests/adapter_tests/
============================= test session starts ==============================
platform linux -- Python 3.6.7, pytest-5.4.3, py-1.7.0, pluggy-0.12.0
rootdir: /home/travis/build/slackapi/bolt-python, inifile: pytest.ini
plugins: cov-2.10.1
collected 53 items
tests/adapter_tests/test_aws_chalice.py ....F.                           [ 11%]
tests/adapter_tests/test_aws_lambda.py ........                          [ 26%]
tests/adapter_tests/test_bottle.py ...                                   [ 32%]
tests/adapter_tests/test_bottle_oauth.py .                               [ 33%]
tests/adapter_tests/test_cherrypy.py ....                                [ 41%]
tests/adapter_tests/test_cherrypy_oauth.py ..                            [ 45%]
tests/adapter_tests/test_django.py ....                                  [ 52%]
tests/adapter_tests/test_falcon.py ....                                  [ 60%]
tests/adapter_tests/test_fastapi.py ....                                 [ 67%]
tests/adapter_tests/test_flask.py ....                                   [ 75%]
tests/adapter_tests/test_lambda_s3_oauth_flow.py .                       [ 77%]
tests/adapter_tests/test_pyramid.py ....                                 [ 84%]
tests/adapter_tests/test_starlette.py ....                               [ 92%]
tests/adapter_tests/test_tornado.py ...                                  [ 98%]
tests/adapter_tests/test_tornado_oauth.py .                              [100%]
=================================== FAILURES ===================================
______________________ TestAwsChalice.test_lazy_listeners ______________________
self = <tests.adapter_tests.test_aws_chalice.TestAwsChalice object at 0x7fcdd5cbcfd0>
    def test_lazy_listeners(self):
        app = App(client=self.web_client, signing_secret=self.signing_secret,)
    
        def command_handler(ack):
            ack()
    
        def say_it(say):
            say("Done!")
    
        app.command("/hello-world")(ack=command_handler, lazy=[say_it])
    
        input = (
            "token=verification_token"
            "&team_id=T111"
            "&team_domain=test-domain"
            "&channel_id=C111"
            "&channel_name=random"
            "&user_id=W111"
            "&user_name=primary-owner"
            "&command=%2Fhello-world"
            "&text=Hi"
            "&enterprise_id=E111"
            "&enterprise_name=Org+Name"
            "&response_url=https%3A%2F%2Fhooks.slack.com%2Fcommands%2FT111%2F111%2Fxxxxx"
            "&trigger_id=111.111.xxx"
        )
        timestamp, body = str(int(time())), input
    
        chalice_app = Chalice(app_name="bolt-python-chalice")
        slack_handler = ChaliceSlackRequestHandler(app=app, chalice=chalice_app)
    
        headers = self.build_headers(timestamp, body)
        headers["x-slack-bolt-lazy-only"] = "1"
        headers["x-slack-bolt-lazy-function-name"] = "say_it"
    
        request: Request = Request(
            method="NONE",
            query_params={},
            uri_params={},
            context={},
            stage_vars=None,
            is_base64_encoded=False,
            body=body,
>           headers=headers,
        )
E       TypeError: __init__() got an unexpected keyword argument 'method'
tests/adapter_tests/test_aws_chalice.py:242: TypeError
=============================== warnings summary ===============================

Category (place an x in each of the [ ])

tests

Requirements

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

@seratch
Copy link
Member Author

seratch commented Sep 18, 2020

Fixed by d1dc479

@seratch seratch closed this as completed Sep 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant