Browse Source

command line option

PYADPT-55
Volker Birk 6 years ago
parent
commit
b6e437cc68
  1. 18
      test/sync_handshake.py
  2. 9
      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)

9
test/sync_test.py

@ -9,7 +9,6 @@
import os, pathlib, sys
from optparse import OptionParser
def test_for(path):
@ -71,9 +70,13 @@ def waitpid(pid):
return
if __name__ == "__main__":
from optparse import OptionParser
optParser = OptionParser()
optParser.add_option("-c", "--clean", action="store_true", dest="clean")
(options, args) = optParser.parse_args()
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")

Loading…
Cancel
Save