def test_on_change(self):
     x = Autoreloader(Mock(), modules=[__name__])
     mm = x._maybe_modified = Mock(0)
     mm.return_value = True
     x._reload = Mock()
     x.file_to_module[__name__] = __name__
     x.on_change([__name__])
     self.assertTrue(x._reload.called)
     mm.return_value = False
     x.on_change([__name__])
Beispiel #2
0
 def test_on_change(self):
     x = Autoreloader(Mock(), modules=[__name__])
     mm = x._maybe_modified = Mock(0)
     mm.return_value = True
     x._reload = Mock()
     x.file_to_module[__name__] = __name__
     x.on_change([__name__])
     self.assertTrue(x._reload.called)
     mm.return_value = False
     x.on_change([__name__])
 def test_reload(self):
     x = Autoreloader(Mock(), modules=[__name__])
     x._reload([__name__])
     x.controller.reload.assert_called_with([__name__], reload=True)
Beispiel #4
0
 def test_reload(self):
     x = Autoreloader(Mock(), modules=[__name__])
     x._reload([__name__])
     x.controller.reload.assert_called_with([__name__], reload=True)