当前位置: 首页>>代码示例>>Python>>正文


Python unittest.fail函数代码示例

本文整理汇总了Python中twisted.trial.unittest.fail函数的典型用法代码示例。如果您正苦于以下问题:Python fail函数的具体用法?Python fail怎么用?Python fail使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了fail函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: request_exit_status

 def request_exit_status(self, status):
     status, = struct.unpack('>L', status)
     if status == 0:
         unittest.fail('false exit status was 0')
     log.msg('finished false')
     self.conn.addResult()
     return 1
开发者ID:andrewbird,项目名称:vodafone-mobile-connect,代码行数:7,代码来源:test_ssh.py

示例2: closed

 def closed(self):
     if self.status != 0:
         unittest.fail('err exit status was not 0: %i' % self.status)
     if self.testBuf != "hello\r\n":
         unittest.fail('err did not return hello: %s' % repr(self.testBuf))
     unittest.assertEquals(self.localWindowLeft, 4)
     unittest.assert_(self.eofCalled)
     log.msg('finished err')
     self.conn.addResult()
     return 1
开发者ID:williamsjj,项目名称:twisted,代码行数:10,代码来源:test_ssh.py

示例3: global_tcpip_forward

 def global_tcpip_forward(self, data):
     host, port = forwarding.unpackGlobal_tcpip_forward(data)
     try: listener = reactor.listenTCP(port,
             forwarding.SSHListenForwardingFactory(self.conn,
                 (host, port),
                 forwarding.SSHListenServerForwardingChannel),
             interface = host)
     except:
         log.err()
         unittest.fail("something went wrong with remote->local forwarding")
         return 0
     else:
         self.listeners[(host, port)] = listener
         return 1
开发者ID:williamsjj,项目名称:twisted,代码行数:14,代码来源:test_ssh.py

示例4: execute

 def execute(self, args, p, preargs = ''):
     if runtime.platformType == 'win32':
         raise unittest.SkipTest, "can't run cmdline client on win32"
     port = self.server.getHost().port
     cmd1 = ('-p %i -l testuser '
             '--known-hosts kh_test '
             '--user-authentications publickey '
             '--host-key-algorithms ssh-rsa '
             '-a '
             '-K direct '
             '-i dsa_test '
             '127.0.0.1') % port
     cmd2 = ('-p %i -l testuser '
             '-K unix '
             '-v ') % port + preargs + \
             ' 127.0.0.1 ' + args
     cmds1 = cmd1.split()
     cmds2 = _makeArgs(cmd2.split())
     o = options.ConchOptions()
     def _(host, *args):
         o['host'] = host
     o.parseArgs = _
     o.parseOptions(cmds1)
     vhk = default.verifyHostKey
     conn = SSHTestConnectionForUnix(p, sys.executable, cmds2)
     uao = default.SSHUserAuthClient(o['user'], o, conn)
     d = connect.connect(o['host'], int(o['port']), o, vhk, uao)
     d.addErrback(lambda f: unittest.fail('Failure connecting to test server: %s' % f))
     d.addCallback(lambda x : p.deferred)
     d.addCallback(lambda x : defer.maybeDeferred(
         conn.transport.transport.loseConnection))
     return d
开发者ID:galaxysd,项目名称:BitTorrent,代码行数:32,代码来源:test_conch.py

示例5: _ebRequestFailed

 def _ebRequestFailed(self, reason):
     unittest.fail('max packet exec failed: %s' % reason)
开发者ID:williamsjj,项目名称:twisted,代码行数:2,代码来源:test_ssh.py

示例6: openFailed

 def openFailed(self, reason):
     unittest.fail('max packet open failed: %s' % reason)
开发者ID:williamsjj,项目名称:twisted,代码行数:2,代码来源:test_ssh.py

示例7: receiveError

 def receiveError(self, reasonCode, desc):
     self.expectedLoseConnection = 1
     if not self.allowedToError:
         unittest.fail('got disconnect for %s: reason %s, desc: %s' %
                        (self, reasonCode, desc))
     self.loseConnection()
开发者ID:andrewbird,项目名称:vodafone-mobile-connect,代码行数:6,代码来源:test_ssh.py

示例8: receiveUnimplemented

 def receiveUnimplemented(self, seqID):
     unittest.fail('got unimplemented: seqid %s'  % seqID)
     self.expectedLoseConnection = 1
     self.loseConnection()
开发者ID:williamsjj,项目名称:twisted,代码行数:4,代码来源:test_ssh.py

示例9: _ebRealRequestFailed

 def _ebRealRequestFailed(self, reason):
     unittest.fail('opening crazy subsystem failed: %s' % reason)
开发者ID:williamsjj,项目名称:twisted,代码行数:2,代码来源:test_ssh.py

示例10: _ebPtyReq

 def _ebPtyReq(self, reason):
     unittest.fail('pty request failed: %s' % reason)
开发者ID:williamsjj,项目名称:twisted,代码行数:2,代码来源:test_ssh.py

示例11: dataReceived

 def dataReceived(self, data):
     unittest.fail('got data when using false')
开发者ID:williamsjj,项目名称:twisted,代码行数:2,代码来源:test_ssh.py

示例12: _cbRequestWorked

 def _cbRequestWorked(self, ignored):
     unittest.fail('fail exec succeeded')
开发者ID:williamsjj,项目名称:twisted,代码行数:2,代码来源:test_ssh.py

示例13: channelOpen

 def channelOpen(self, ignored):
     unittest.fail("opened unknown channel")
开发者ID:williamsjj,项目名称:twisted,代码行数:2,代码来源:test_ssh.py

示例14: ssh_USERAUTH_SUCCESS

 def ssh_USERAUTH_SUCCESS(self, packet):
     if not self.canSucceedPassword and self.canSucceedPublicKey:
         unittest.fail('got USERAUTH_SUCESS before password and publickey')
     userauth.SSHUserAuthClient.ssh_USERAUTH_SUCCESS(self, packet)
开发者ID:williamsjj,项目名称:twisted,代码行数:4,代码来源:test_ssh.py

示例15: errReceived

 def errReceived(self, dataType, data):
     unittest.fail('echo channel got extended data')
开发者ID:williamsjj,项目名称:twisted,代码行数:2,代码来源:test_ssh.py


注:本文中的twisted.trial.unittest.fail函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。