Esempio n. 1
0
 def test_previous_image_first_image(self, mock_view):
     args = mock.Mock()
     args.input_dir = None
     model = Model(args)
     controller = Controller(model, mock_view)
     model.images = ["abc.png", "test.png", "ababaa.png"]
     model.current_file = 0
     controller.previous_image()
     self.assertEqual(0, model.current_file)
Esempio n. 2
0
 def test_previous_image(self, mock_view, mock_load_image):
     args = mock.Mock()
     args.input_dir = None
     model = Model(args)
     controller = Controller(model, mock_view)
     model.images = ["abc.png", "test.png", "ababaa.png"]
     model.current_file = 1
     controller.previous_image()
     mock_load_image.assert_called_with = model.images[2]
     self.assertEqual(0, model.current_file)