def test_mongodb_autoreconnect(self): """ Test that if mongodb disconnects once was connected, a autoreconect loop will start waiting for mongodb to recover """ from max.tests.base import FAILURES FAILURES.set(3) username = '******' self.create_user(username) self.testapp.get('/people/{}'.format(username), '', headers=oauth2Header(test_manager), status=200)
def test_mongodb_autoreconnect_and_crash(self): """ Test that if mongodb disconnects once was connected, a autoreconect loop will start waiting for mongodb to recover, And if a different exception raises in between, loop will exit and raise the exception """ from max.tests.base import FAILURES FAILURES.set(3) username = '******' res = self.create_user(username, expect=500) self.assertEqual(res.json['error'], 'ServerError')