Example #1
0
 def test_resize(self):
     img = RGBEImage(wxparent, log)
     img.doPfilt = mock.MagicMock()
     img.doPfilt.return_value = True
     img._analyzeImage = mock.MagicMock()
     img.resize(600, 400)
     msg = "_analyzeImage() was not called after successful resize()"
     self.assertTrue(img._analyzeImage.called, msg)
Example #2
0
 def test_resize_fail(self):
     img = RGBEImage(wxparent, log)
     img.doPfilt = mock.MagicMock()
     img.doPfilt.return_value = False
     img._analyzeImage = mock.MagicMock()
     img.resize(600, 400)
     msg = "_analyzeImage() was called after failed resize()"
     self.assertFalse(img._analyzeImage.called, msg)
Example #3
0
 def test_doPfilt(self):
     img = RGBEImage(wxparent, log)
     img._doPcommand = mock.MagicMock()
     args = ['a', 2]
     img.doPfilt(args)
     img._doPcommand.assert_called_with("pfilt", args)