87826c4ccb971911752adbc4bdac8d3e7c28989e,tests/test_actions.py,,test_remote_action_endpoint_responds_400,#Any#Any#Any#,254

Before Change


            remote_action.run(default_dispatcher_collecting,
                              tracker,
                              default_domain))
    httpretty.disable()
    assert execinfo.type == ActionExecutionRejection
    assert "Custom action "my_action" rejected to run" in str(execinfo.value)

After Change


    endpoint = EndpointConfig("https://example.com/webhooks/actions")
    remote_action = action.RemoteAction("my_action", endpoint)

    with aioresponses() as mocked:
        // noinspection PyTypeChecker
        mocked.post(
            "https://example.com/webhooks/actions",
            exception=ClientResponseError(
                aiohttp.ClientResponseError(None, None, code=400),
                "{"action_name": "my_action"}"))

        with pytest.raises(Exception) as execinfo:
            loop.run_until_complete(
                remote_action.run(default_dispatcher_collecting,
                                  tracker,
                                  default_domain))

    assert execinfo.type == ActionExecutionRejection
    assert "Custom action "my_action" rejected to run" in str(execinfo.value)

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 5

Instances


Project Name: RasaHQ/rasa
Commit Name: 87826c4ccb971911752adbc4bdac8d3e7c28989e
Time: 2019-01-21
Author: tom@rasa.com
File Name: tests/test_actions.py
Class Name:
Method Name: test_remote_action_endpoint_responds_400


Project Name: RasaHQ/rasa
Commit Name: 87826c4ccb971911752adbc4bdac8d3e7c28989e
Time: 2019-01-21
Author: tom@rasa.com
File Name: tests/test_examples.py
Class Name:
Method Name: test_formbot_example


Project Name: RasaHQ/rasa
Commit Name: 87826c4ccb971911752adbc4bdac8d3e7c28989e
Time: 2019-01-21
Author: tom@rasa.com
File Name: tests/test_actions.py
Class Name:
Method Name: test_remote_action_endpoint_responds_500


Project Name: RasaHQ/rasa
Commit Name: 87826c4ccb971911752adbc4bdac8d3e7c28989e
Time: 2019-01-21
Author: tom@rasa.com
File Name: tests/test_channels.py
Class Name:
Method Name: test_callback_calls_endpoint


Project Name: RasaHQ/rasa
Commit Name: 87826c4ccb971911752adbc4bdac8d3e7c28989e
Time: 2019-01-21
Author: tom@rasa.com
File Name: tests/test_utils.py
Class Name:
Method Name: test_endpoint_config