diff options
author | mike <michael.jmontcalm@gmail.com> | 2009-04-26 21:42:20 (GMT) |
---|---|---|
committer | mike <michael.jmontcalm@gmail.com> | 2009-04-26 21:42:20 (GMT) |
commit | 2a1c6d6fbcb60c44d8690add635260faf243dcd6 (patch) | |
tree | 25b10b497c515416370cbc0dd86e05bd6a2f4155 /src/sugar/tutorius/tests/serializertests.py | |
parent | a4114a946cc7a57c1cfce5760737c3f05425bc86 (diff) | |
parent | e784a2f0b92ecaf46a77ddca94b31fcc86e0cbae (diff) |
(LP 352437) Core : Completed basic serializer interactions with core
(actions, event filters) - needs tests
Also, merged branch 'mike' into jc_support
Conflicts:
source/external/source/sugar-toolkit/src/sugar/tutorius/actions.py
source/external/source/sugar-toolkit/src/sugar/tutorius/bundler.py
source/external/source/sugar-toolkit/src/sugar/tutorius/tests/run-tests.py
source/external/source/sugar-toolkit/src/sugar/tutorius/tests/serializertests.py
Diffstat (limited to 'src/sugar/tutorius/tests/serializertests.py')
-rw-r--r-- | src/sugar/tutorius/tests/serializertests.py | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/src/sugar/tutorius/tests/serializertests.py b/src/sugar/tutorius/tests/serializertests.py index 75fe8eb..2a743e1 100644 --- a/src/sugar/tutorius/tests/serializertests.py +++ b/src/sugar/tutorius/tests/serializertests.py @@ -39,6 +39,28 @@ from sugar.tutorius.bundler import * from uuid import * import rpdb2 +class SerializerInterfaceTest(unittest.TestCase): + """ + For completeness' sake. + """ + def test_save(self): + ser = Serializer() + + try: + ser.save_fsm(None) + assert False, "save_fsm() should throw an unimplemented error" + except: + pass + + def test_load(self): + ser = Serializer() + + try: + ser.load_fsm(str(uuid.uuid1)) + assert False, "load_fsm() should throw an unimplemented error" + except: + pass + class XMLSerializerTest(unittest.TestCase): """ Tests the transformation of XML to FSM, then back. @@ -104,10 +126,11 @@ class XMLSerializerTest(unittest.TestCase): 'FSM underlying dictionary differ from original to pickled/reformed one' assert loaded_fsm._states.get("Second").name == self.fsm._states.get("Second").name, \ 'FSM underlying dictionary differ from original to pickled/reformed one' - assert loaded_fsm._states.get("INIT").get_action_list()[0].get_message() == \ - self.fsm._states.get("INIT").get_action_list()[0].get_message(), \ + assert loaded_fsm._states.get("INIT").get_action_list()[0].message.value == \ + self.fsm._states.get("INIT").get_action_list()[0].message.value, \ 'FSM underlying State underlying Action differ from original to reformed one' - + assert len(loaded_fsm.get_action_list()) == 0, "FSM should not have any actions on itself" + os.remove(os.path.join(sugar.tutorius.bundler._get_store_root(), str(self.uuid)) + "/fsm.xml") if os.path.isdir(testpath): shutil.rmtree(testpath) |