Example #1
0
 def test__run_handling__not_interrupted(self):
     mock = Mock(__class__=BaseCollector)
     BaseCollector.run_handling(mock)
     mock.run.assert_called_once_with()
     self.assertEqual(mock.stop.mock_calls, [])
Example #2
0
 def test__run_handling__interrupted(self):
     mock = Mock(__class__=BaseCollector,
                 run=Mock(side_effect=KeyboardInterrupt))
     BaseCollector.run_handling(mock)
     mock.run.assert_called_once_with()
     mock.stop.assert_called_once_with()