def test_scale_image_subtask_gets_right_value_for_antialias(self): class MockImage(object): pass mock_image = MockImage() mock_image.resize = Mock(return_value='hey_ya') return_value = ans.scale_image_subtask('batman_antialias', mock_image) current_app_width = current_app.config['STILL_IMAGE_WIDTH'] current_app_height = current_app.config['STILL_IMAGE_HEIGHT'] mock_image.resize.assert_called_once_with( (current_app_width, current_app_height), Image.ANTIALIAS) assert return_value == 'hey_ya'
def test_scale_image_subtask_gets_right_value_for_bilinear(self): class MockImage(object): pass mock_image = MockImage() mock_image.resize = Mock(return_value='hey_ya') return_value = ans.scale_image_subtask('bilinear_algebra', mock_image) current_app_width = current_app.config['STILL_IMAGE_WIDTH'] current_app_height = current_app.config['STILL_IMAGE_HEIGHT'] mock_image.resize.assert_called_once_with( (current_app_width, current_app_height), Image.BILINEAR) assert return_value == 'hey_ya'