def test__apply_propagates_replacement_policy(self):

    class MockMetadata(Metadata):

        def apply(self, *args, **kwargs):
            self.called_with = (args, kwargs)
    metadata = MockMetadata(data_source=DataSource.OCLC, primary_identifier=self._identifier())
    provider = IdentifierLookupCoverageProvider(self._default_collection, replacement_policy=object())
    provider._apply(metadata)
    (args, kwargs) = metadata.called_with
    assert (kwargs['replace'] == provider.replacement_policy)
def test__apply_propagates_replacement_policy(self):

    class MockMetadata(Metadata):

        def apply(self, *args, **kwargs):
            self.called_with = (args, kwargs)
    metadata = MockMetadata(data_source=DataSource.OCLC, primary_identifier=self._identifier())
    provider = IdentifierLookupCoverageProvider(self._default_collection, replacement_policy=object())
    provider._apply(metadata)
    (args, kwargs) = metadata.called_with
    assert (kwargs['replace'] == provider.replacement_policy)