##// END OF EJS Templates
Use assertEqual when possible
Takafumi Arakaki -
Show More
@@ -58,9 +58,9 b' class ZMQTerminalInteractiveShellTestCase(unittest.TestCase):'
58 with monkeypatch(PIL.Image, 'open', fake_open):
58 with monkeypatch(PIL.Image, 'open', fake_open):
59 self.shell.handle_image_PIL(self.data, self.mime)
59 self.shell.handle_image_PIL(self.data, self.mime)
60
60
61 assert len(open_called_with) == 1
61 self.assertEqual(len(open_called_with), 1)
62 assert len(show_called_with) == 1
62 self.assertEqual(len(show_called_with), 1)
63 assert open_called_with[0].getvalue() == self.raw
63 self.assertEqual(open_called_with[0].getvalue(), self.raw)
64
64
65 def check_handler_with_file(self, inpath, handler):
65 def check_handler_with_file(self, inpath, handler):
66 shell = self.shell
66 shell = self.shell
@@ -76,7 +76,7 b' class ZMQTerminalInteractiveShellTestCase(unittest.TestCase):'
76 getattr(shell, funcname)(self.data, self.mime)
76 getattr(shell, funcname)(self.data, self.mime)
77 transferred = file.read()
77 transferred = file.read()
78
78
79 assert transferred == self.raw
79 self.assertEqual(transferred, self.raw)
80
80
81 def test_handle_image_stream(self):
81 def test_handle_image_stream(self):
82 self.check_handler_with_file('-', 'stream')
82 self.check_handler_with_file('-', 'stream')
@@ -88,5 +88,5 b' class ZMQTerminalInteractiveShellTestCase(unittest.TestCase):'
88 called_with = []
88 called_with = []
89 self.shell.callable_image_handler = called_with.append
89 self.shell.callable_image_handler = called_with.append
90 self.shell.handle_image_callable(self.data, self.mime)
90 self.shell.handle_image_callable(self.data, self.mime)
91 assert len(called_with) == 1
91 self.assertEqual(len(called_with), 1)
92 assert called_with[0] is self.data
92 assert called_with[0] is self.data
General Comments 0
You need to be logged in to leave comments. Login now