def test_get_prev_next_urn(self, requests): text = CtsText("urn:cts:latinLit:phi1294.phi002.perseus-lat2", retriever=self.endpoint) requests.return_value.text = NEXT_PREV _prev, _next = text.getPrevNextUrn("1.1") self.assertEqual(_prev, "1.pr", "Endpoint should be called and URN should be parsed") self.assertEqual(_next, "1.2", "Endpoint should be called and URN should be parsed")
def getSiblings(self, textId, subreference): """ Retrieve the siblings of a textual node :param textId: CtsTextMetadata Identifier :type textId: str :param subreference: CapitainsCtsPassage Reference :type subreference: str :return: Tuple of references :rtype: (str, str) """ text = CtsText(urn=textId, retriever=self.endpoint) return text.getPrevNextUrn(subreference)