def testGetDocNotLoggedIn(self): self.mox.StubOutWithMock(resumr, 'IsLoggedIn') self.mox.StubOutWithMock(resumr, 'abort') resumr.IsLoggedIn().AndReturn( False ) resumr.abort( 401 ).AndRaise( Exception ) self.mox.ReplayAll() with self.assertRaises( Exception ): resumr.GetDoc() self.mox.VerifyAll()
def testGetDocMissingKeys(self): self.mox.StubOutWithMock(resumr, 'IsLoggedIn') self.mox.StubOutWithMock(resumr, 'abort') resumr.IsLoggedIn().AndReturn( True ) resumr.abort( 401 ).AndRaise( Exception ) self.mox.ReplayAll() with resumr.app.test_request_context('/'): resumr.app.preprocess_request() with self.assertRaises( Exception ): resumr.GetDoc() self.mox.VerifyAll()