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)"}, )
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)"}, )
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