Skip to content

Conversation

@rohanjadvani
Copy link
Contributor

No description provided.

@codecov
Copy link

codecov bot commented Jan 28, 2020

Codecov Report

Merging #9 into master will increase coverage by 2.16%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master       #9      +/-   ##
==========================================
+ Coverage   93.90%   96.06%   +2.16%     
==========================================
  Files           5        7       +2     
  Lines          82      127      +45     
==========================================
+ Hits           77      122      +45     
  Misses          5        5              
Impacted Files Coverage Δ
workos/utils/validation.py 100.00% <0.00%> (ø)
workos/audit_log.py 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8bb8c4f...740fa45. Read the comment docs.


def test_create_audit_log_event_succeeds(self, mock_request_method):
event = {
"group": "Terrace House",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Geez.. how many terrace house fans do we have at workos now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually got the object from here, but I am a Terrace House fan 😅

mock_response.status_code = 200
mock_request_method("post", mock_response, 200)
response = self.audit_log.create_event(event)
assert mock_response.status_code == 200
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likely essentially the same thing, but did you mean assert response.status_code == 200?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah, will fix

Returns:
dict: Response from WorkOS
"""
metadata_limit = 50
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you feel about having this and events_path as a constant?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to re-factor the limit to a constant. The path I think is a bit local, but I'm happy to change that as well for consistency

from workos.exceptions import ConfigurationException


def validate_api_key_and_project_id(module_name):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

Copy link
Contributor

@henrylamchan henrylamchan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good to me 👍

Looks like one of the checks are complaining about blackifying the code though /shrug

@rohanjadvani rohanjadvani merged commit f3e3f25 into master Jan 28, 2020
@rohanjadvani rohanjadvani deleted the rohanjadvani/ch1207/implement-audit-logs branch January 28, 2020 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants