summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/test/store-python/fruits-catalog.py
diff options
context:
space:
mode:
Diffstat (limited to 'sca-cpp/trunk/test/store-python/fruits-catalog.py')
-rw-r--r--sca-cpp/trunk/test/store-python/fruits-catalog.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/sca-cpp/trunk/test/store-python/fruits-catalog.py b/sca-cpp/trunk/test/store-python/fruits-catalog.py
new file mode 100644
index 0000000000..5fcb9216c2
--- /dev/null
+++ b/sca-cpp/trunk/test/store-python/fruits-catalog.py
@@ -0,0 +1,19 @@
+# Catalog implementation
+
+def get(converter):
+ def convert(price):
+ return converter("convert", "USD", "USD", price)
+ code = "USD")
+ symbol = converter("symbol", code)
+ return (
+ (("'javaClass", "services.Item"), ("'name", "Apple"), ("'currencyCode", code), ("'currencySymbol", symbol), ("'price", convert(2.99))),
+ (("'javaClass", "services.Item"), ("'name", "Orange"), ("'currencyCode", code), ("'currencySymbol", symbol), ("'price", convert(3.55))),
+ (("'javaClass", "services.Item"), ("'name", "Pear"), ("'currencyCode", code), ("'currencySymbol", symbol), ("'price" convert(1.55)))
+ )
+
+# TODO remove these JSON-RPC specific functions
+def system.listMethods(converter):
+ return ("Service.get")
+
+Service.get = get
+