Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorBenjamin Saller <bcsaller@objectrealms.net>2007-07-06 21:12:35 (GMT)
committer Benjamin Saller <bcsaller@objectrealms.net>2007-07-06 21:12:35 (GMT)
commit76e540a1f3cac2968d85bb3c469cb685c35097d6 (patch)
tree5ff23ba607939c0704acee000aa626098890865d /bin
parent18b79510269fa0c6bb5380e6634aebc943d6d556 (diff)
adding tests for Web like application data
Diffstat (limited to 'bin')
-rwxr-xr-xbin/test-indexprop.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/bin/test-indexprop.py b/bin/test-indexprop.py
new file mode 100755
index 0000000..fa0a5c3
--- /dev/null
+++ b/bin/test-indexprop.py
@@ -0,0 +1,34 @@
+#!/usr/bin/env python
+import dbus
+import os
+
+def main():
+ bus = dbus.SessionBus()
+ datastore = bus.get_object("org.laptop.sugar.DataStore",
+ "/org/laptop/sugar/DataStore")
+
+ props = {'title:text': 'title',
+ 'title_set_by_user': '1',
+ 'buddies': '',
+ 'keep': '0',
+ 'icon-color': '#40011d,#79079a',
+ 'activity': 'org.laptop.WebActivity',
+ 'mime_type': 'text/plain'}
+
+ uid = datastore.create(props, os.path.abspath('tests/web_data.json'))
+ print "created uid", uid
+
+ result, count = datastore.find(dict(fulltext='title'))
+ assert result[0]['uid'] == uid
+ for k, v in result[0].items():
+ print "\t", k, v
+ print open(datastore.get_filename(uid), 'r').read()
+ print "OK"
+
+ datastore.delete(uid)
+
+if __name__ == '__main__':
+ #a = Application("client", main)
+ #a.plugins.append('ore.main.profile_support.ProfileSupport')
+ #a()
+ main()