Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormike <michael.jmontcalm@gmail.com>2009-03-19 20:24:53 (GMT)
committer mike <michael.jmontcalm@gmail.com>2009-03-19 20:24:53 (GMT)
commit6e12fd2dc93303b8ef799e1aedf4944da445673b (patch)
tree43634e773056fd7af0d25bc83a2ec81de8980aa9
parente20cfb534e276fa7762980bbdd6d633a7ce99ccc (diff)
parent29fd92fe5d474816aa8adf8a34c3d4d584d81cc7 (diff)
Merge branch 'tutorial_toolkit' of ssh://mike@bobthebuilder.mine.nu:8080/home/git into tutorial_toolkit
-rw-r--r--src/sugar/tutorius/tests/servicestests.py53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/sugar/tutorius/tests/servicestests.py b/src/sugar/tutorius/tests/servicestests.py
new file mode 100644
index 0000000..d669012
--- /dev/null
+++ b/src/sugar/tutorius/tests/servicestests.py
@@ -0,0 +1,53 @@
+# Copyright (C) 2009, Tutorius.org
+# Copyright (C) 2009, Michael Janelle-Montcalm <michael.jmontcalm@gmail.com>
+# Copyright (C) 2009, Vincent Vinet <vince.vinet@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+"""Services tests"""
+
+import unittest
+
+from sugar.tutorius.services import *
+
+
+class ObjectStoreTests(unittest.TestCase):
+ def setUp(self):
+ self.os1 = ObjectStore()
+ self.os2 = ObjectStore()
+
+ def tearDown(self):
+ del self.os1
+ del self.os2
+ ObjectStore.instance = None
+
+ def test_singleton(self):
+ """
+ Validate that the object store is a singleton
+ """
+ assert self.os1 is self.os2, "Both objectstore objects should be the same"
+
+ def test_activity(self):
+ """Validate the activity property"""
+ act = object()
+ self.os1.activity = act
+ assert self.os1.activity is self.os2.activity
+
+ def test_tutorial(self):
+ """Validate the tutorial property"""
+ tut = object()
+ self.os1.tutorial = tut
+ assert self.os1.tutorial is self.os2.tutorial
+
+