Skip to content

Commit

Permalink
fix: remove timestamp restriction on registerFeedback
Browse files Browse the repository at this point in the history
This field is optional.
  • Loading branch information
figueredo committed Jul 18, 2024
1 parent 8dc6718 commit 94fa944
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
2 changes: 0 additions & 2 deletions incognia/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ def register_feedback(self,
session_token: Optional[str] = None) -> None:
if not event:
raise IncogniaError('event is required.')
if not timestamp:
raise IncogniaError('timestamp is required.')

try:
headers = self.__get_authorization_header()
Expand Down
12 changes: 0 additions & 12 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,18 +203,6 @@ def test_register_feedback_when_event_is_empty_should_raise_an_IncogniaError(
mock_token_manager_get.assert_not_called()
mock_base_request_post.assert_not_called()

@patch.object(BaseRequest, 'post')
@patch.object(TokenManager, 'get', return_value=TOKEN_VALUES)
def test_register_feedback_when_timestamp_is_none_should_raise_an_IncogniaError(
self, mock_token_manager_get: Mock, mock_base_request_post: Mock):
api = IncogniaAPI(self.CLIENT_ID, self.CLIENT_SECRET)

self.assertRaises(IncogniaError, api.register_feedback,
event=self.VALID_EVENT_FEEDBACK_TYPE, timestamp=None)

mock_token_manager_get.assert_not_called()
mock_base_request_post.assert_not_called()

@patch.object(BaseRequest, 'post')
@patch.object(TokenManager, 'get', return_value=TOKEN_VALUES)
def test_register_feedback_when_required_fields_are_invalid_should_raise_an_IncogniaHTTPError(
Expand Down

0 comments on commit 94fa944

Please sign in to comment.