Пример #1
0
    def test_event_list_by_actor_request_has_correct_paramaters(self,):
        with mock_response():
            cased.policy_key = "cs_test_001"

            Event.list_by_actor("test")

            cased.http.HTTPClient.make_request.assert_called_with(
                "get",
                "https://api.cased.com/events/",
                "cs_test_001",
                {"per_page": 25, "phrase": "(actor:test)"},
            )
Пример #2
0
    def test_event_list_by_actor_request_api_key_can_be_overrode(self):
        with mock_response():
            cased.policy_key = "cs_test_001"

            Event.list_by_actor("test", api_key="alt_key")

            cased.http.HTTPClient.make_request.assert_called_with(
                "get",
                "https://api.cased.com/events/",
                "alt_key",
                {"per_page": 25, "phrase": "(actor:test)"},
            )
Пример #3
0
    def test_event_can_list_by_actor(self):
        with mock_response():
            cased.policy_key = "cs_test_001"

            assert Event.list_by_actor("test").results