From 4413c7c88bbf79738ff8aef61261acd11813da87 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Tue, 24 May 2016 16:15:46 +0100 Subject: [PATCH] Add extra unit test for IsEnclosedBy rule --- gramps/gen/filters/rules/test/place_rules_test.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gramps/gen/filters/rules/test/place_rules_test.py b/gramps/gen/filters/rules/test/place_rules_test.py index e2e09a5ae..145790868 100644 --- a/gramps/gen/filters/rules/test/place_rules_test.py +++ b/gramps/gen/filters/rules/test/place_rules_test.py @@ -207,12 +207,23 @@ class BaseTest(unittest.TestCase): """ Test IsEnclosedBy rule. """ - rule = IsEnclosedBy(['P0001']) + rule = IsEnclosedBy(['P0001', '0']) self.assertEqual(self.filter_with_rule(rule), set([ b'EAFKQCR0ED5QWL87EO', b'S22LQCLUZM135LVKRL', b'VDUJQCFP24ZV3O4ID2', b'V6ALQCZZFN996CO4D', b'OC6LQCXMKP6NUVYQD8', b'CUUKQC6BY5LAZXLXC6', b'PTFKQCKPHO2VC5SYKS', b'PHUJQCJ9R4XQO5Y0WS'])) + def test_isenclosedby_inclusive(self): + """ + Test IsEnclosedBy rule with inclusive option. + """ + rule = IsEnclosedBy(['P0001', '1']) + self.assertEqual(self.filter_with_rule(rule), set([ + b'c96587262e91149933fcea5f20a', b'EAFKQCR0ED5QWL87EO', + b'S22LQCLUZM135LVKRL', b'VDUJQCFP24ZV3O4ID2', b'V6ALQCZZFN996CO4D', + b'OC6LQCXMKP6NUVYQD8', b'CUUKQC6BY5LAZXLXC6', b'PTFKQCKPHO2VC5SYKS', + b'PHUJQCJ9R4XQO5Y0WS'])) + if __name__ == "__main__": unittest.main()