示例#1
0
文件: tests.py 项目: obmarg/resumr
    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()
示例#2
0
文件: tests.py 项目: obmarg/resumr
    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()