def _parse_citation(ancestry: _IntermediateAncestry, element: Element) -> None: handle = _xpath1(element, './@handle') source_handle = _xpath1(element, './ns:sourceref/@hlink') citation = Citation(_xpath1(element, './@id'), ancestry.sources[source_handle]) citation.date = _parse_date(element) _parse_objref(ancestry, citation, element) _parse_attribute_privacy(citation, element) page = _xpath1(element, './ns:page') if page is not None: citation.location = page.text ancestry.citations[handle] = citation
def test_location(self) -> None: sut = Citation(Mock(Source)) self.assertIsNone(sut.location) location = 'Somewhere' sut.location = location self.assertEquals(location, sut.location)