Browse Source

option -n: no end

PYADPT-55
Volker Birk 6 years ago
parent
commit
e3dc1efaa9
  1. 14
      test/sync_handshake.py
  2. 5
      test/sync_test.py

14
test/sync_handshake.py

@ -110,10 +110,11 @@ class UserInterface(pEp.UserInterface):
pEp.sync_handshake_signal.SYNC_NOTIFY_INIT_ADD_OUR_DEVICE,
pEp.sync_handshake_signal.SYNC_NOTIFY_INIT_FORM_GROUP
):
end_on.extend([
pEp.sync_handshake_signal.SYNC_NOTIFY_SOLE,
pEp.sync_handshake_signal.SYNC_NOTIFY_IN_GROUP,
])
if isinstance(end_on, list):
end_on.extend([
pEp.sync_handshake_signal.SYNC_NOTIFY_SOLE,
pEp.sync_handshake_signal.SYNC_NOTIFY_IN_GROUP,
])
try:
if options.reject:
self.deliverHandshakeResult(SYNC_HANDSHAKE_REJECTED)
@ -197,6 +198,8 @@ if __name__=="__main__":
optParser.add_option("-j", "--multi-threaded", action="store_true",
dest="multithreaded",
help="use multithreaded instead of single threaded implementation")
optParser.add_option("-n", "--noend", action="store_true",
dest="noend", help="do not end")
options, args = optParser.parse_args()
if not options.exec_for:
@ -208,6 +211,9 @@ if __name__=="__main__":
except TypeError:
end_on = (end_on,)
if options.noend:
end_on = (None,)
multithreaded = options.multithreaded
run(options.exec_for, options.color)

5
test/sync_test.py

@ -89,6 +89,8 @@ if __name__ == "__main__":
help="setup environment, then stop")
optParser.add_option("-p", "--print", action="store_true", dest="print",
help="print sync message trace in inbox")
optParser.add_option("-n", "--noend", action="store_true", dest="noend",
help="do not end")
optParser.add_option("-E", "--end-on", dest="notifications",
help="end test on these notifications")
optParser.add_option("-3", "--third-device", action="store_true", dest="third",
@ -167,6 +169,9 @@ if __name__ == "__main__":
try: None in end_on
except TypeError:
end_on = (end_on,)
elif options.noend:
end_on = (None,)
Phone = Process(target=test_for, args=("Phone", "red", end_on,
options.multithreaded))
Laptop = Process(target=test_for, args=("Laptop", "green", end_on,

Loading…
Cancel
Save