Skip to content

Conversation

jfboismenu
Copy link
Contributor

@jfboismenu jfboismenu commented Mar 23, 2018

While writing unit tests in Toolkit I stumbled upon this bug, where searching for a sub-entity field would crash if any of the sub-entity field was set to None. See unit test for more info.

Also, PEP8ed mockgun.py. The actual fix is on line 679

@jfboismenu jfboismenu requested a review from josh-t March 23, 2018 12:38
Copy link
Contributor

@josh-t josh-t left a comment

Choose a reason for hiding this comment

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

minor nitpicky comments about formatting and commented out code. :shipit:


def find(
self,
entity_type, filters, fields=None,
Copy link
Contributor

Choose a reason for hiding this comment

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

this formatting seems a bit arbitrary. Any reason it's done this way?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

First line is self, next three is the most common-only used params to the method and then the rest. Should I simply break them on two lines? One arg per line seems wasteful to me.

results = self.find(entity_type, filters, fields=fields, order=order, filter_operator=filter_operator, retired_only=retired_only)
def find_one(
self,
entity_type, filters, fields=None,
Copy link
Contributor

Choose a reason for hiding this comment

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

same.

"%s.%s is of type entity, but data %s does not contain 'type' and 'id'"
% (entity_type, field, item)
)
# elif item["type"] not in field_info["properties"]["valid_types"]["value"]:
Copy link
Contributor

Choose a reason for hiding this comment

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

any reason why this is commented out? maybe make a comment to say why it has been left in?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe it's not obvious from the diff, but it was already commented out. I only reformatted it because it was longer than 120 chars. Unfortunately we don't know why it was commented out...

@jfboismenu jfboismenu merged commit 4b5764b into master Mar 23, 2018
@jfboismenu jfboismenu deleted the 46904_site_wide_defcon2 branch April 5, 2018 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants