Skip to content

Commit

Permalink
add __repr__ functions for easier testing #259
Browse files Browse the repository at this point in the history
  • Loading branch information
MRichards99 committed Dec 2, 2021
1 parent 490470e commit df323fe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions datagateway_api/src/search_api/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ def __str__(self):

return str_conds[0]

def __repr__(self):
return f"Field: '{self.field}', Value: '{self.value}', Operation: '{self.operation}'"


class SearchAPISkipFilter(PythonICATSkipFilter):
def __init__(self, skip_value):
Expand Down
3 changes: 3 additions & 0 deletions datagateway_api/src/search_api/nested_where_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@ def __str__(self):
operator
"""
return f"({str(self.lhs)} {self.joining_operator} {str(self.rhs)})"

def __repr__(self):
return f"LHS: {repr(self.lhs)}, RHS: {repr(self.rhs)}, Operator: {repr(self.joining_operator)}"

0 comments on commit df323fe

Please sign in to comment.