'Test the run method of the upgrader'

@blocking_call_on_reactor_thread
def test_run(self):

    def check_should_upgrade():
        self.upgrader.failed = True
        return (True, False)
    self.upgrader.session.config.get_upgrader_enabled = (lambda : True)
    self.upgrader.check_should_upgrade_database = check_should_upgrade
    self.upgrader.run()
    self.assertTrue(self.upgrader.notified)
