Exemplo n.º 1
0
    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()
Exemplo n.º 2
0
    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()