Skip to content

Commit

Permalink
Really remove xor
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidMStraub committed Feb 14, 2025
1 parent 6e6c39d commit a16023f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 44 deletions.
24 changes: 12 additions & 12 deletions gramps_webapi/data/apispec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ paths:
{"function": function, "invert": invert, "rules": [{"name": name, "values": [values], "regex": regex}]}
The function value is a string for the logical operation. Valid values are 'and', 'or', 'xor' and 'one'. If not present the default is 'and'.
The function value is a string for the logical operation. Valid values are 'and', 'or' and 'one'. If not present the default is 'and'.
The invert value is a boolean, true or false, that indicates if the results should be inverted. If not present the default is false.
Expand Down Expand Up @@ -1380,7 +1380,7 @@ paths:
{"function": function, "invert": invert, "rules": [{"name": name, "values": [values], "regex": regex}]}
The function value is a string for the logical operation. Valid values are 'and', 'or', 'xor' and 'one'. If not present the default is 'and'.
The function value is a string for the logical operation. Valid values are 'and', 'or' and 'one'. If not present the default is 'and'.
The invert value is a boolean, true or false, that indicates if the results should be inverted. If not present the default is false.
Expand Down Expand Up @@ -1861,7 +1861,7 @@ paths:
{"function": function, "invert": invert, "rules": [{"name": name, "values": [values], "regex": regex}]}
The function value is a string for the logical operation. Valid values are 'and', 'or', 'xor' and 'one'. If not present the default is 'and'.
The function value is a string for the logical operation. Valid values are 'and', 'or' and 'one'. If not present the default is 'and'.
The invert value is a boolean, true or false, that indicates if the results should be inverted. If not present the default is false.
Expand Down Expand Up @@ -2248,7 +2248,7 @@ paths:
{"function": function, "invert": invert, "rules": [{"name": name, "values": [values], "regex": regex}]}
The function value is a string for the logical operation. Valid values are 'and', 'or', 'xor' and 'one'. If not present the default is 'and'.
The function value is a string for the logical operation. Valid values are 'and', 'or' and 'one'. If not present the default is 'and'.
The invert value is a boolean, true or false, that indicates if the results should be inverted. If not present the default is false.
Expand Down Expand Up @@ -2577,7 +2577,7 @@ paths:
{"function": function, "invert": invert, "rules": [{"name": name, "values": [values], "regex": regex}]}
The function value is a string for the logical operation. Valid values are 'and', 'or', 'xor' and 'one'. If not present the default is 'and'.
The function value is a string for the logical operation. Valid values are 'and', 'or' and 'one'. If not present the default is 'and'.
The invert value is a boolean, true or false, that indicates if the results should be inverted. If not present the default is false.
Expand Down Expand Up @@ -2894,7 +2894,7 @@ paths:
{"function": function, "invert": invert, "rules": [{"name": name, "values": [values], "regex": regex}]}
The function value is a string for the logical operation. Valid values are 'and', 'or', 'xor' and 'one'. If not present the default is 'and'.
The function value is a string for the logical operation. Valid values are 'and', 'or' and 'one'. If not present the default is 'and'.
The invert value is a boolean, true or false, that indicates if the results should be inverted. If not present the default is false.
Expand Down Expand Up @@ -3183,7 +3183,7 @@ paths:
{"function": function, "invert": invert, "rules": [{"name": name, "values": [values], "regex": regex}]}
The function value is a string for the logical operation. Valid values are 'and', 'or', 'xor' and 'one'. If not present the default is 'and'.
The function value is a string for the logical operation. Valid values are 'and', 'or' and 'one'. If not present the default is 'and'.
The invert value is a boolean, true or false, that indicates if the results should be inverted. If not present the default is false.
Expand Down Expand Up @@ -3484,7 +3484,7 @@ paths:
{"function": function, "invert": invert, "rules": [{"name": name, "values": [values], "regex": regex}]}
The function value is a string for the logical operation. Valid values are 'and', 'or', 'xor' and 'one'. If not present the default is 'and'.
The function value is a string for the logical operation. Valid values are 'and', 'or' and 'one'. If not present the default is 'and'.
The invert value is a boolean, true or false, that indicates if the results should be inverted. If not present the default is false.
Expand Down Expand Up @@ -4177,7 +4177,7 @@ paths:
{"function": function, "invert": invert, "rules": [{"name": name, "values": [values], "regex": regex}]}
The function value is a string for the logical operation. Valid values are 'and', 'or', 'xor' and 'one'. If not present the default is 'and'.
The function value is a string for the logical operation. Valid values are 'and', 'or' and 'one'. If not present the default is 'and'.
The invert value is a boolean, true or false, that indicates if the results should be inverted. If not present the default is false.
Expand Down Expand Up @@ -5791,7 +5791,7 @@ paths:
{"function": function, "invert": invert, "rules": [{"name": name, "values": [values], "regex": regex}]}
The function value is a string for the logical operation. Valid values are 'and', 'or', 'xor' and 'one'. If not present the default is 'and'.
The function value is a string for the logical operation. Valid values are 'and', 'or' and 'one'. If not present the default is 'and'.
The invert value is a boolean, true or false, that indicates if the results should be inverted. If not present the default is false.
Expand Down Expand Up @@ -5961,7 +5961,7 @@ paths:
{"function": function, "invert": invert, "rules": [{"name": name, "values": [values], "regex": regex}]}
The function value is a string for the logical operation. Valid values are 'and', 'or', 'xor' and 'one'. If not present the default is 'and'.
The function value is a string for the logical operation. Valid values are 'and', 'or' and 'one'. If not present the default is 'and'.
The invert value is a boolean, true or false, that indicates if the results should be inverted. If not present the default is false.
Expand Down Expand Up @@ -9838,7 +9838,7 @@ definitions:
type: string
example: "All private males."
function:
description: "Logical operation to use in evaluating multiple rules. Must be 'and', 'or', 'xor' or 'one'"
description: "Logical operation to use in evaluating multiple rules. Must be 'and', 'or' or 'one'"
type: string
example: "and"
invert:
Expand Down
9 changes: 0 additions & 9 deletions tests/test_endpoints/test_families.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,15 +291,6 @@ def test_get_families_parameter_rules_expected_response_or_function(self):
)
self.assertEqual(len(rv), 6)

def test_get_families_parameter_rules_expected_response_xor_function(self):
"""Test rules parameter expected response for xor function."""
rv = check_success(
self,
TEST_URL
+ '?keys=handle&rules={"function":"xor","rules":[{"name":"IsBookmarked"},{"name":"HasRelType","values":["Unknown"]}]}',
)
self.assertEqual(len(rv), 6)

def test_get_families_parameter_rules_expected_response_one_function(self):
"""Test rules parameter expected response for one function."""
rv = check_success(
Expand Down
10 changes: 0 additions & 10 deletions tests/test_endpoints/test_notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,15 +271,6 @@ def test_get_notes_parameter_rules_expected_response_or_function(self):
)
self.assertEqual(len(rv), 3)

def test_get_notes_parameter_rules_expected_response_xor_function(self):
"""Test rules parameter expected response for xor function."""
rv = check_success(
self,
TEST_URL
+ '?keys=handle&rules={"function":"xor","rules":[{"name":"HasType","values":["Person Note"]},{"name":"NotePrivate"}]}',
)
self.assertEqual(len(rv), 3)

def test_get_notes_parameter_rules_expected_response_one_function(self):
"""Test rules parameter expected response for one function."""
rv = check_success(
Expand Down Expand Up @@ -488,4 +479,3 @@ def test_get_notes_link_format(self):
'<a href="__I0044__GNUJQCL9MD64AM56OH__person__">Lewis Anderson Garner</a>',
html,
)

13 changes: 0 additions & 13 deletions tests/test_endpoints/test_people.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,19 +341,6 @@ def test_get_people_parameter_rules_expected_response_or_function(self):
for tag in item["tag_list"]:
self.assertIn(tag, tag_handles)

def test_get_people_parameter_rules_expected_response_xor_function(self):
"""Test rules parameter expected response for xor function."""
rv = check_success(
self,
TEST_URL
+ '?keys=gender,family_list&rules={"function":"xor","rules":[{"name":"IsFemale"},{"name":"MultipleMarriages"}]}',
)
for item in rv:
if item["gender"] == 0:
self.assertLess(len(item["family_list"]), 2)
if len(item["family_list"]) > 1:
self.assertNotEqual(item["gender"], 0)

def test_get_people_parameter_rules_expected_response_one_function(self):
"""Test rules parameter expected response for one function."""
rv = check_success(
Expand Down

0 comments on commit a16023f

Please sign in to comment.