Skip to content

Commit

Permalink
test(citations): Add new test cases for citations
Browse files Browse the repository at this point in the history
  • Loading branch information
quevon24 committed Dec 20, 2024
1 parent 54b18eb commit 084a681
Showing 1 changed file with 31 additions and 3 deletions.
34 changes: 31 additions & 3 deletions tests/test_FindTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,13 +477,41 @@ def test_find_citations(self):
[case_citation(metadata={'pin_cite': '2277, 2278, 2279, 2280, 2281, 2282, 2283, 2284, 2286, 2287, 2288, 2289, 2290, 2291'})]),
# Test volume nominative reporter
("Ridgely's Notebook, 362",
[case_citation(volume=None, reporter="Ridgely's Notebook", groups={'volume': None, 'reporter': "Ridgely's Notebook", 'page': '362'})]),
[case_citation(volume=None,
reporter="Ridgely's Notebook",
groups={'volume': None,
'reporter': "Ridgely's Notebook",
'page': '362'}
)]),
# Test volume nominative reporter with right single quotation mark
('Bayard’s Notebook, 235',
[case_citation(volume=None, reporter="Bayard’s Notebook", groups={'volume': None, 'reporter': 'Bayard’s Notebook', 'page': '235'})]),
[case_citation(volume=None,
reporter="Bayard’s Notebook",
groups={'volume': None,
'reporter': 'Bayard’s Notebook',
'page': '235'}
)]),
# Test citation with parallel citation in parentheses
('24 Del. (1 Boyce) 1',
[case_citation(reporter="Del.", groups={'volume': '24', 'reporter': 'Del.', 'parallel_volume': '1', 'reporter_nominative': 'Boyce', 'page': '1'})]),
[case_citation(reporter="Del.",
groups={'volume': '24',
'reporter': 'Del.',
'parallel_volume': '1',
'parallel_reporter': 'Boyce',
'page': '1'}
)]),
# Test citation with parallel citation in parentheses and year
('Smith v. Henry, 18 S.C.L. (2 Bail.) 118 (1831)',
[case_citation(reporter="S.C.L.",
year=1831,
groups={'volume': '18',
'reporter': 'S.C.L.',
'parallel_volume': '2',
'parallel_reporter': 'Bail.',
'page': '118'},
metadata={'plaintiff': 'Smith',
'defendant': 'Henry'}
)]),
)
# fmt: on
self.run_test_pairs(test_pairs, "Citation extraction")
Expand Down

0 comments on commit 084a681

Please sign in to comment.