forked from hyperledger-archives/aries-protocol-test-suite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.py
59 lines (49 loc) · 2.05 KB
/
default.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
"""Default implementations."""
from protocol_tests.backchannel import (
Backchannel, SubjectConnectionInfo
)
from protocol_tests.connection.backchannel import ConnectionsBackchannel
def pause():
"""Pause for input before continuing."""
input('Press ENTER to continue.')
class ManualBackchannel(Backchannel, ConnectionsBackchannel):
"""
Manually complete backchannel actions by copying and pasting values between
subject and terminal.
"""
async def setup(self, config, suite):
pass
async def reset(self):
print('Reset test subject to clean state.')
pause()
async def new_connection(self, info, parameters=None):
print(
'Enter the following info into your agent '
'to create a new connection:\n'
)
print('DID: {}\nVerkey: {}\nLabel: {}\nEndpoint: {}\n'.format(
info.did, info.verkey, info.label, info.endpoint
))
did = input('Input connection DID generated by test subject: ')
recipients = input(
'Input recipients as comma-separated, base58-encoded values: '
)
recipients = map(lambda recip: recip.strip(), recipients.split(','))
recipients = list(filter(lambda recip: recip, recipients))
routing_keys = input(
'Input routing keys as comma-separated, base58-encoded values'
' (hit ENTER for none): '
)
routing_keys = map(
lambda recip: recip.strip(), routing_keys.split(',')
)
routing_keys = list(filter(lambda recip: recip, routing_keys))
endpoint = input('Input connection endpoint: ')
return SubjectConnectionInfo(did, recipients, routing_keys, endpoint)
async def connections_v1_0_inviter_start(self) -> str:
print('Generate a new invitation on test subject.')
return input('Enter invitation URL: ')
async def connections_v1_0_invitee_start(self, invite):
print('Paste the following invitation into the test subject.')
print('Generated invitation: ', invite)
pause()