Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tests/units/toolkit/gbus.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/units/toolkit/gbus.py')
-rwxr-xr-xtests/units/toolkit/gbus.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/units/toolkit/gbus.py b/tests/units/toolkit/gbus.py
new file mode 100755
index 0000000..e5ef530
--- /dev/null
+++ b/tests/units/toolkit/gbus.py
@@ -0,0 +1,31 @@
+#!/usr/bin/env python
+# sugar-lint: disable
+
+from __init__ import tests
+
+from sugar_network.toolkit import gbus
+
+
+class GbusTest(tests.Test):
+
+ def test_call(self):
+
+ def op(result, arg):
+ result.set(arg)
+
+ self.assertEqual('probe', gbus.call(op, 'probe'))
+
+ def test_pipe(self):
+
+ def op(pipe, args):
+ for i in args:
+ pipe(i)
+ pipe()
+
+ self.assertEqual(
+ [1, 2, 3],
+ [i for i in gbus.pipe(op, [1, 2, 3])])
+
+
+if __name__ == '__main__':
+ tests.main()