Ejemplo n.º 1
0
    def test_event_list_by_action_request_has_correct_paramaters(self):
        with mock_response():
            cased.policy_key = "cs_test_001"

            Event.list_by_action("test-event")

            cased.http.HTTPClient.make_request.assert_called_with(
                "get",
                "https://api.cased.com/events/",
                "cs_test_001",
                {"per_page": 25, "phrase": "(action:test-event)"},
            )
Ejemplo n.º 2
0
    def test_event_list_by_action_request_api_key_can_be_overrode(self):
        with mock_response():
            cased.policy_key = "cs_test_001"

            Event.list_by_action("test-event", api_key="alt_key")

            cased.http.HTTPClient.make_request.assert_called_with(
                "get",
                "https://api.cased.com/events/",
                "alt_key",
                {"per_page": 25, "phrase": "(action:test-event)"},
            )
Ejemplo n.º 3
0
    def test_event_can_list_by_action(self):
        with mock_response():
            cased.policy_key = "cs_test_001"

            assert Event.list_by_action("user.login").results