Example #1
0
 def it_can_retrieve_srels_for_a_source_uri(self,
                                            _SerializedRelationships_):
     # mockery ----------------------
     phys_reader = Mock(name='phys_reader')
     source_uri = Mock(name='source_uri')
     rels_xml = phys_reader.rels_xml_for.return_value
     load_from_xml = _SerializedRelationships_.load_from_xml
     srels = load_from_xml.return_value
     # exercise ---------------------
     retval = PackageReader._srels_for(phys_reader, source_uri)
     # verify -----------------------
     phys_reader.rels_xml_for.assert_called_once_with(source_uri)
     load_from_xml.assert_called_once_with(source_uri.baseURI, rels_xml)
     assert retval == srels
 def it_can_retrieve_srels_for_a_source_uri(
         self, _SerializedRelationships_):
     # mockery ----------------------
     phys_reader = Mock(name='phys_reader')
     source_uri = Mock(name='source_uri')
     rels_xml = phys_reader.rels_xml_for.return_value
     load_from_xml = _SerializedRelationships_.load_from_xml
     srels = load_from_xml.return_value
     # exercise ---------------------
     retval = PackageReader._srels_for(phys_reader, source_uri)
     # verify -----------------------
     phys_reader.rels_xml_for.assert_called_once_with(source_uri)
     load_from_xml.assert_called_once_with(source_uri.baseURI, rels_xml)
     assert retval == srels