mirror of
https://github.com/romanz/amodem.git
synced 2026-05-10 05:17:38 +08:00
trezor: add ping for self-test
This commit is contained in:
@@ -42,6 +42,10 @@ class ConnectionMock(object):
|
|||||||
result.node.public_key = PUBKEY
|
result.node.public_key = PUBKEY
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
def ping(self, msg):
|
||||||
|
assert not self.closed
|
||||||
|
return msg
|
||||||
|
|
||||||
|
|
||||||
class FactoryMock(object):
|
class FactoryMock(object):
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ class Client(object):
|
|||||||
log.debug('revision : %s', binascii.hexlify(f.revision))
|
log.debug('revision : %s', binascii.hexlify(f.revision))
|
||||||
|
|
||||||
def __enter__(self):
|
def __enter__(self):
|
||||||
|
msg = 'Hello World!'
|
||||||
|
assert self.client.ping(msg) == msg
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def __exit__(self, *args):
|
def __exit__(self, *args):
|
||||||
|
|||||||
Reference in New Issue
Block a user