twisted.trial.unittest.fail

Here are the examples of the python api twisted.trial.unittest.fail taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

31 Examples 7

Example 1

Project: mythbox Source File: test_ssh.py
Function: 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

Example 2

Project: mythbox Source File: test_ssh.py
Function: connection_lost
        def connectionLost(self, reason):
            if self.done:
                return
            if not hasattr(self,'expectedLoseConnection'):
                unittest.fail('unexpectedly lost connection %s\n%s' % (self, reason))
            self.done = 1

Example 3

Project: mythbox Source File: test_ssh.py
        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

Example 4

Project: mythbox Source File: test_ssh.py
Function: closed
        def closed(self):
            if self.status != 0:
                unittest.fail('echo exit status was not 0: %i' % self.status)
            if self.testBuf != "hello\r\n":
                unittest.fail('echo did not return hello: %s' % repr(self.testBuf))
            unittest.assertEquals(self.localWindowLeft, 4)
            unittest.assert_(self.eofCalled)
            log.msg('finished echo')
            self.conn.addResult()
            return 1

Example 5

Project: mythbox Source File: test_ssh.py
Function: 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

Example 6

Project: mythbox Source File: test_ssh.py
Function: closed
        def closed(self):
            if self.status != 0:
                unittest.fail('echo exit status was not 0: %i' % self.status)
            unittest.assertEquals(self.testBuf, 'hello\r\n')
            unittest.assertEquals(self.testExtBuf, 'hello\r\n')
            unittest.assertEquals(self.localWindowLeft, 12)
            unittest.assert_(self.eofCalled)
            log.msg('finished max packet')
            self.conn.addResult()
            return 1

Example 7

Project: mythbox Source File: test_ssh.py
        def receiveUnimplemented(self, seqID):
            unittest.fail('got unimplemented: seqid %s'  % seqID)
            self.expectedLoseConnection = 1
            self.loseConnection()

Example 8

Project: mythbox Source File: test_ssh.py
Function: 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)

Example 9

Project: mythbox Source File: test_ssh.py
Function: channel_open
        def channelOpen(self, ignored):
            unittest.fail("opened unknown channel")

Example 10

Project: mythbox Source File: test_ssh.py
Function: open_failed
        def openFailed(self, reason):
            unittest.fail('fail exec open failed: %s' % reason)

Example 11

Project: mythbox Source File: test_ssh.py
Function: cbrequestworked
        def _cbRequestWorked(self, ignored):
            unittest.fail('fail exec succeeded')

Example 12

Project: mythbox Source File: test_ssh.py
Function: open_failed
        def openFailed(self, reason):
            unittest.fail('false open failed: %s' % reason)

Example 13

Project: mythbox Source File: test_ssh.py
Function: ebrequestfailed
        def _ebRequestFailed(self, reason):
            unittest.fail('false exec failed: %s' % reason)

Example 14

Project: mythbox Source File: test_ssh.py
Function: data_received
        def dataReceived(self, data):
            unittest.fail('got data when using false')

Example 15

Project: mythbox Source File: test_ssh.py
Function: open_failed
        def openFailed(self, reason):
            unittest.fail('echo open failed: %s' % reason)

Example 16

Project: mythbox Source File: test_ssh.py
Function: ebrequestfailed
        def _ebRequestFailed(self, reason):
            unittest.fail('echo exec failed: %s' % reason)

Example 17

Project: mythbox Source File: test_ssh.py
Function: errreceived
        def errReceived(self, dataType, data):
            unittest.fail('echo channel got extended data')

Example 18

Project: mythbox Source File: test_ssh.py
Function: open_failed
        def openFailed(self, reason):
            unittest.fail('err open failed: %s' % reason)

Example 19

Project: mythbox Source File: test_ssh.py
Function: ebrequestfailed
        def _ebRequestFailed(self, reason):
            unittest.fail('err exec failed: %s' % reason)

Example 20

Project: mythbox Source File: test_ssh.py
Function: data_received
        def dataReceived(self, data):
            unittest.fail('err channel got regular data: %s' % repr(data))

Example 21

Project: mythbox Source File: test_ssh.py
Function: open_failed
        def openFailed(self, reason):
            unittest.fail('max packet open failed: %s' % reason)

Example 22

Project: mythbox Source File: test_ssh.py
Function: ebrequestfailed
        def _ebRequestFailed(self, reason):
            unittest.fail('max packet exec failed: %s' % reason)

Example 23

Project: mythbox Source File: test_ssh.py
Function: open_failed
        def openFailed(self, reason):
            unittest.fail('shell open failed: %s' % reason)

Example 24

Project: mythbox Source File: test_ssh.py
        def _ebPtyReq(self, reason):
            unittest.fail('pty request failed: %s' % reason)

Example 25

Project: mythbox Source File: test_ssh.py
        def _ebShellOpen(self, reason):
            unittest.fail('shell request failed: %s' % reason)

Example 26

Project: mythbox Source File: test_ssh.py
Function: open_failed
        def openFailed(self, reason):
            unittest.fail('subsystem open failed: %s' % reason)

Example 27

Project: mythbox Source File: test_ssh.py
Function: cbrequestworked
        def _cbRequestWorked(self, ignored):
            unittest.fail('opened non-crazy subsystem')

Example 28

Project: mythbox Source File: test_ssh.py
        def _ebRealRequestFailed(self, reason):
            unittest.fail('opening crazy subsystem failed: %s' % reason)

Example 29

Project: mythbox Source File: test_ssh.py
        def _ebFirstGlobal(self, reason):
            unittest.fail('first global request failed: %s' % reason)

Example 30

Project: mythbox Source File: test_ssh.py
        def _ebSecondGlobal(self, reason):
            unittest.fail('second global request failed: %s' % reason)

Example 31

Project: mythbox Source File: test_ssh.py
        def _cbThirdGlobal(self, ignored):
            unittest.fail('second global request succeeded')