def test_rotate_image(self): mock_img = Mock() mock_img.__enter__().height = 200 mock_img.__enter__().width = 800 autorotate.wand.image.Image = Mock(return_value=mock_img) autorotate.rotate_image('foo.jpg', 90) assert mock_img.__enter__().rotate.call_args_list == [call(90)] assert mock_img.__enter__().save.call_args_list == [ call(filename='foo.jpg')]
def test_rotate_image(self): mock_img = Mock() mock_img.__enter__().height = 200 mock_img.__enter__().width = 800 autorotate.wand.image.Image = Mock(return_value=mock_img) autorotate.rotate_image('foo.jpg', 90) assert mock_img.__enter__().rotate.call_args_list == [call(90)] assert mock_img.__enter__().save.call_args_list == [ call(filename='foo.jpg') ]
def test_rotate_image(self): mock_img = Mock() mock_img.__enter__().height = 200 mock_img.__enter__().width = 800 autorotate.wand.image.Image = Mock(return_value=mock_img) with patch('spreadsplug.autorotate.subprocess.check_output'): autorotate.rotate_image('foo.jpg', 90) assert mock_img.__enter__().rotate.call_args_list == [call(90)] assert mock_img.__enter__().save.call_args_list == [ call(filename='foo.jpg')]