Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@sugarlabs.org>2013-05-21 08:14:45 (GMT)
committer Aleksey Lim <alsroot@sugarlabs.org>2013-05-21 08:14:45 (GMT)
commit770d15fab0714d9363ced3f80b85abb94ef52e2b (patch)
tree0edc8c160c701d4fa97df8578c0f04ae49a180a4
parent35780392f6b7ad018efdfedbfe61a059c7fd0cd0 (diff)
Missed files
-rwxr-xr-xtests/units/client/solver.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/units/client/solver.py b/tests/units/client/solver.py
new file mode 100755
index 0000000..62f8f28
--- /dev/null
+++ b/tests/units/client/solver.py
@@ -0,0 +1,25 @@
+#!/usr/bin/env python
+# sugar-lint: disable
+
+import os
+
+from __init__ import tests
+
+from sugar_network.client import solver
+
+
+class SolverTest(tests.Test):
+
+ def test_select_architecture(self):
+ host_arch = os.uname()[-1]
+
+ self.assertEqual(host_arch, solver.select_architecture(
+ sorted(solver.machine_ranks.keys(), cmp=lambda x, y: cmp(solver.machine_ranks[x], solver.machine_ranks[y]))))
+ self.assertEqual(host_arch, solver.select_architecture(
+ sorted(solver.machine_ranks.keys(), cmp=lambda x, y: cmp(solver.machine_ranks[y], solver.machine_ranks[x]))))
+ self.assertEqual(host_arch, solver.select_architecture([host_arch]))
+ self.assertEqual(host_arch, solver.select_architecture(['foo', host_arch, 'bar']))
+
+
+if __name__ == '__main__':
+ tests.main()