def test_resource_verify(mocker): mock = mocker.patch( 'cekit.descriptor.resource.Resource._Resource__check_sum') res = Resource({'url': 'dummy'}) res.checksums = {'sha256': 'justamocksum'} res._Resource__verify('dummy') mock.assert_called_with('dummy', 'sha256', 'justamocksum')
def test_generated_url_with_cacher(): tools.cfg['common'] = {} tools.cfg['common']['cache_url'] = '#filename#,#algorithm#,#hash#' res = Resource({'url': 'dummy'}) res.checksums = {'sha256': 'justamocksum'} res.name = 'file' assert res._Resource__substitute_cache_url( 'file') == 'file,sha256,justamocksum' tools.cfg = {}