예제 #1
0
    def test_session_persistence_xml(self):

        actual_xml = """{xml_header}
                            <{root_tag}
                                type="{type_}"
                                cookie_name="{cookie_name}"
                            xmlns="{xmlns}" />""".format(
            xml_header=self.XML_HEADER,
            xmlns=self.XML_NS,
            root_tag=self.ROOT_TAG,
            type_=self.type_,
            cookie_name=self.cookie_name)
        actual_obj = SessionPersistence.deserialize(actual_xml, 'xml')
        self.assertEqual(self.expected_obj, actual_obj)
예제 #2
0
    def test_session_persistence_json(self):

        actual_json = """
                        {{ "{root_tag}":
                            {{
                                "type": "{type_}",
                                "cookie_name": "{cookie_name}"
                            }}
                        }}
                        """.format(root_tag=self.ROOT_TAG,
                                   type_=self.type_,
                                   cookie_name=self.cookie_name)
        actual_obj = SessionPersistence.deserialize(actual_json, 'json')
        self.assertEqual(self.expected_obj, actual_obj)