Browse Source

command line option

PYADPT-55
Volker Birk 6 years ago
parent
commit
b6e437cc68
  1. 18
      test/sync_handshake.py
  2. 15
      test/sync_test.py

18
test/sync_handshake.py

@ -18,12 +18,24 @@ def messageToSend(msg):
class UserInterface(pEp.UserInterface):
def notifyHandshake(self, me, partner, signal):
print("signal " + str(signal) + " for identities " + str(me) + " " + str(partner))
print("signal " + str(signal) + " for identities " + str(me) + " " +
str(partner))
def run(path):
me = pEp.Identity("alice@peptest.ch", path + " Neuman")
def run(name):
me = pEp.Identity("alice@peptest.ch", name + " Neuman")
pEp.myself(me)
pEp.messageToSend = messageToSend
ui = UserInterface()
if __name__=="__main__":
from optparse import OptionParser
optParser = OptionParser()
optParser.add_option("-e", "--exec-for", action="store", type="string",
dest="exec_for", help="execute for name")
options, args = optParser.parse_args()
run(options.exec_for)

15
test/sync_test.py

@ -9,7 +9,6 @@
import os, pathlib, sys
from optparse import OptionParser
def test_for(path):
@ -71,16 +70,20 @@ def waitpid(pid):
return
optParser = OptionParser()
optParser.add_option("-c", "--clean", action="store_true", dest="clean")
(options, args) = optParser.parse_args()
if __name__ == "__main__":
from optparse import OptionParser
if options.clean:
optParser = OptionParser()
optParser.add_option("-c", "--clean", action="store_true", dest="clean",
help="remove all generated files")
options, args = optParser.parse_args()
if options.clean:
rmrf("TestInbox")
rmrf("Alice")
rmrf("Barbara")
else:
else:
os.makedirs("TestInbox", exist_ok=True)
setup("Alice")
setup("Barbara")

Loading…
Cancel
Save