本文整理汇总了Python中twisted.trial.unittest.assertEquals函数的典型用法代码示例。如果您正苦于以下问题:Python assertEquals函数的具体用法?Python assertEquals怎么用?Python assertEquals使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了assertEquals函数的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: closed
def closed(self):
log.msg("calling shell closed")
if self.status != 0:
log.msg("shell exit status was not 0: %i" % self.status)
unittest.assertEquals(self.testBuf, "testing the shell!\x00\r\n")
unittest.assert_(self.eofCalled)
log.msg("finished shell")
self.conn.addResult()
开发者ID:jsober,项目名称:twisted,代码行数:8,代码来源:test_ssh.py
示例2: receiveError
def receiveError(self, reasonCode, desc):
self.expectedLoseConnection = 1
# Some versions of OpenSSH (for example, OpenSSH_5.3p1) will
# send a DISCONNECT_BY_APPLICATION error before closing the
# connection. Other, older versions (for example,
# OpenSSH_5.1p1), won't. So accept this particular error here,
# but no others.
unittest.assertEquals(
reasonCode, transport.DISCONNECT_BY_APPLICATION,
'got disconnect for %s: reason %s, desc: %s' % (
self, reasonCode, desc))
self.loseConnection()
开发者ID:williamsjj,项目名称:twisted,代码行数:12,代码来源:test_ssh.py
示例3: _cbRealRequestWorked
def _cbRealRequestWorked(self, ignored):
d1 = self.conn.sendGlobalRequest('foo', 'bar', 1)
d1.addErrback(self._ebFirstGlobal)
d2 = self.conn.sendGlobalRequest('foo-2', 'bar2', 1)
d2.addCallback(lambda x: unittest.assertEquals(x, 'data'))
d2.addErrback(self._ebSecondGlobal)
d3 = self.conn.sendGlobalRequest('bar', 'foo', 1)
d3.addCallback(self._cbThirdGlobal)
d3.addErrback(lambda x,s=self: log.msg('subsystem finished') or s.conn.addResult() or s.loseConnection())
开发者ID:williamsjj,项目名称:twisted,代码行数:11,代码来源:test_ssh.py
示例4: _cbRealRequestWorked
def _cbRealRequestWorked(self, ignored):
d1 = self.conn.sendGlobalRequest("foo", "bar", 1)
d1.addErrback(self._ebFirstGlobal)
d2 = self.conn.sendGlobalRequest("foo-2", "bar2", 1)
d2.addCallback(lambda x: unittest.assertEquals(x, "data"))
d2.addErrback(self._ebSecondGlobal)
d3 = self.conn.sendGlobalRequest("bar", "foo", 1)
d3.addCallback(self._cbThirdGlobal)
d3.addErrback(lambda x, s=self: log.msg("subsystem finished") or s.conn.addResult() or s.loseConnection())
开发者ID:jsober,项目名称:twisted,代码行数:11,代码来源:test_ssh.py
示例5: global_foo_2
def global_foo_2(self, data):
unittest.assertEquals(data, 'bar2')
return 1, 'data'
开发者ID:williamsjj,项目名称:twisted,代码行数:3,代码来源:test_ssh.py
示例6: global_foo
def global_foo(self, data):
unittest.assertEquals(data, 'bar')
return 1
开发者ID:williamsjj,项目名称:twisted,代码行数:3,代码来源:test_ssh.py
示例7: verifyHostKey
def verifyHostKey(self, key, fp):
unittest.assertEquals(key, keys.Key.fromString(publicRSA_openssh).blob())
unittest.assertEquals(fp,'3d:13:5f:cb:c9:79:8a:93:06:27:65:bc:3d:0b:8f:af')
return defer.succeed(1)
开发者ID:williamsjj,项目名称:twisted,代码行数:4,代码来源:test_ssh.py
示例8: requestAvatar
def requestAvatar(self, avatarID, mind, *interfaces):
unittest.assertEquals(avatarID, 'testuser')
a = ConchTestAvatar()
return interfaces[0], a, a.logout
开发者ID:williamsjj,项目名称:twisted,代码行数:4,代码来源:test_ssh.py
示例9: verifyHostKey
def verifyHostKey(self, key, fp):
unittest.assertEquals(key, keys.getPublicKeyString(data=publicRSA_openssh))
unittest.assertEquals(fp, "3d:13:5f:cb:c9:79:8a:93:06:27:65:bc:3d:0b:8f:af")
return defer.succeed(1)
开发者ID:jsober,项目名称:twisted,代码行数:4,代码来源:test_ssh.py
示例10: openShell
def openShell(self, proto):
log.msg('openning shell')
unittest.assertEquals(self.ptyReq, True)
self.proto = proto
EchoTransport(proto)
self.cmd = 'shell'
开发者ID:williamsjj,项目名称:twisted,代码行数:6,代码来源:test_ssh.py
示例11: checkKey
def checkKey(self, credentials):
unittest.assertEquals(credentials.username, 'testuser', 'bad username')
unittest.assertEquals(credentials.blob, keys.getPublicKeyString(data=publicDSA_openssh))
return 1
开发者ID:andrewbird,项目名称:vodafone-mobile-connect,代码行数:4,代码来源:test_ssh.py
示例12: processEnded
def processEnded(self, reason):
unittest.assertEquals(reason.value.exitCode, 0, 'exit code was not 0: %s' % reason.value.exitCode)
self.buf = self.buf.replace('\r\n', '\n')
unittest.assertEquals(self.buf, 'goodbye\n')
self.deferred.callback(None)
开发者ID:galaxysd,项目名称:BitTorrent,代码行数:5,代码来源:test_conch.py
示例13: extReceived
def extReceived(self, dataType, data):
unittest.assertEquals(dataType, connection.EXTENDED_DATA_STDERR)
self.testExtBuf += data
开发者ID:williamsjj,项目名称:twisted,代码行数:3,代码来源:test_ssh.py
示例14: checkKey
def checkKey(self, credentials):
unittest.assertEquals(credentials.username, 'testuser', 'bad username')
unittest.assertEquals(credentials.blob, keys.Key.fromString(publicDSA_openssh).blob())
return 1
开发者ID:williamsjj,项目名称:twisted,代码行数:4,代码来源:test_ssh.py
示例15: requestAvatarId
def requestAvatarId(self, credentials):
unittest.assertEquals(credentials.username, 'testuser', 'bad username')
unittest.assertEquals(credentials.password, 'testpass', 'bad password')
return defer.succeed(credentials.username)
开发者ID:williamsjj,项目名称:twisted,代码行数:4,代码来源:test_ssh.py
示例16: areDone
def areDone(self, avatarId):
unittest.assertEquals(avatarId, 'testuser')
if len(self.successfulCredentials[avatarId]) < 2:
return 0
else:
return 1
开发者ID:williamsjj,项目名称:twisted,代码行数:6,代码来源:test_ssh.py
示例17: getPty
def getPty(self, term, windowSize, attrs):
log.msg('pty req')
unittest.assertEquals(term, 'conch-test-term')
unittest.assertEquals(windowSize, (24, 80, 0, 0))
self.ptyReq = True
开发者ID:williamsjj,项目名称:twisted,代码行数:5,代码来源:test_ssh.py
注:本文中的twisted.trial.unittest.assertEquals函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论