<s> """<STR_LIT>""" <EOL> import unittest <EOL> from cloudcafe . networking . lbaas . common . constants import Constants <EOL> from cloudcafe . networking . lbaas . lbaas_api . session_persistence . response import SessionPersistence <EOL> class BaseSessionPersistenceResponseTest ( unittest . TestCase ) : <EOL> @ classmethod <EOL> def setUpClass ( cls ) : <EOL> super ( BaseSessionPersistenceResponseTest , cls ) . setUpClass ( ) <EOL> cls . XML_HEADER = Constants . XML_HEADER <EOL> cls . XML_NS = Constants . XML_API_NAMESPACE <EOL> cls . ROOT_TAG = SessionPersistence . ROOT_TAG <EOL> cls . type_ = "<STR_LIT>" <EOL> cls . cookie_name = "<STR_LIT>" <EOL> cls . session_persistence_obj = SessionPersistence ( <EOL> type_ = cls . type_ , <EOL> cookie_name = cls . cookie_name <EOL> ) <EOL> class SessionPersistenceResponseTest ( BaseSessionPersistenceResponseTest ) : <EOL> def setUp ( self ) : <EOL> super ( SessionPersistenceResponseTest , self ) . setUp ( ) <EOL> self . ROOT_TAG = SessionPersistence . ROOT_TAG <EOL> self . expected_obj = self . session_persistence_obj <EOL> def test_session_persistence_json ( self ) : <EOL> actual_json = """<STR_LIT>""" . format ( root_tag = self . ROOT_TAG , <EOL> type_ = self . type_ , <EOL> cookie_name = self . cookie_name ) <EOL> actual_obj = SessionPersistence . deserialize ( actual_json , '<STR_LIT>' ) <EOL> self . assertEqual ( self . expected_obj , actual_obj ) <EOL> def test_session_persistence_xml ( self ) : <EOL> actual_xml = """<STR_LIT>""" . format ( <EOL> xml_header = self . XML_HEADER , <EOL> xmlns = self . XML_NS , <EOL> root_tag = self . ROOT_TAG , <EOL> type_ = self . type_ , <EOL> cookie_name = self . cookie_name ) <EOL> actual_obj = SessionPersistence . deserialize ( actual_xml , '<STR_LIT>' ) <EOL> self . assertEqual ( self . expected_obj , actual_obj ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> unittest . main ( ) </s>
