"""Tests for error correction logic.""" import flexmock from oto import response from assets.logic import correction_images from assets.models import error_correction def test_rename_image_assets(): """Test that the model layer is called and its result is returned.""" product_id = 123 model_response = response.Response(message='hunky dork') (flexmock(error_correction) .should_receive('rename_image_assets') .with_args(product_id) .once() .and_return(model_response)) result = correction_images.rename_image_assets(product_id) assert result == model_response