summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/modules/python/server-test.py
diff options
context:
space:
mode:
Diffstat (limited to 'sca-cpp/trunk/modules/python/server-test.py')
-rw-r--r--sca-cpp/trunk/modules/python/server-test.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/sca-cpp/trunk/modules/python/server-test.py b/sca-cpp/trunk/modules/python/server-test.py
new file mode 100644
index 0000000000..cdef94e116
--- /dev/null
+++ b/sca-cpp/trunk/modules/python/server-test.py
@@ -0,0 +1,29 @@
+# JSON-RPC test case
+
+def echo(x):
+ return x
+
+# ATOMPub test case
+
+def getall():
+ return ("Sample Feed", "123456789",
+ ("Item", "111", (("'javaClass", "services.Item"), ("'name", "Apple"), ("'currencyCode", "USD"), ("'currencySymbol", "$"), ("'price", 2.99))),
+ ("Item", "222", (("'javaClass", "services.Item"), ("'name", "Orange"), ("'currencyCode", "USD"), ("'currencySymbol", "$"), ("'price", 3.55))),
+ ("Item", "333", (("'javaClass", "services.Item"), ("name", "Pear"), ("'currencyCode", "USD"), ("'currencySymbol", "$"), ("'price", 1.55))))
+
+def get(id):
+ entry = (("'javaClass", "services.Item"), ("'name", "Apple"), ("'currencyCode", "USD"), ("'currencySymbol", "$"), ("'price", 2.99))
+ return ("Item", id, entry)
+
+def post(entry):
+ return "123456789"
+
+def put(id, entry):
+ return true
+
+def deleteall():
+ return true
+
+def delete(id):
+ return true
+