aboutsummaryrefslogtreecommitdiffstats
path: root/test/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'test/scripts')
-rw-r--r--test/scripts/all.py4
-rw-r--r--test/scripts/concurrent_decorator.py32
-rw-r--r--test/scripts/concurrent_decorator_err.py5
3 files changed, 41 insertions, 0 deletions
diff --git a/test/scripts/all.py b/test/scripts/all.py
index e6da7e51..7d30d757 100644
--- a/test/scripts/all.py
+++ b/test/scripts/all.py
@@ -3,6 +3,10 @@ def clientconnect(ctx, cc):
ctx.log("XCLIENTCONNECT")
log.append("clientconnect")
+def serverconnect(ctx, cc):
+ ctx.log("XSERVERCONNECT")
+ log.append("serverconnect")
+
def request(ctx, r):
ctx.log("XREQUEST")
log.append("request")
diff --git a/test/scripts/concurrent_decorator.py b/test/scripts/concurrent_decorator.py
new file mode 100644
index 00000000..8e132006
--- /dev/null
+++ b/test/scripts/concurrent_decorator.py
@@ -0,0 +1,32 @@
+import time
+from libmproxy.script import concurrent
+
+
+@concurrent
+def clientconnect(context, cc):
+ context.log("clientconnect")
+
+
+@concurrent
+def serverconnect(context, sc):
+ context.log("serverconnect")
+
+
+@concurrent
+def request(context, flow):
+ time.sleep(0.1)
+
+
+@concurrent
+def response(context, flow):
+ context.log("response")
+
+
+@concurrent
+def error(context, err):
+ context.log("error")
+
+
+@concurrent
+def clientdisconnect(context, dc):
+ context.log("clientdisconnect") \ No newline at end of file
diff --git a/test/scripts/concurrent_decorator_err.py b/test/scripts/concurrent_decorator_err.py
new file mode 100644
index 00000000..78191315
--- /dev/null
+++ b/test/scripts/concurrent_decorator_err.py
@@ -0,0 +1,5 @@
+from libmproxy.script import concurrent
+
+@concurrent
+def start(context, argv):
+ pass \ No newline at end of file