@@ -0,0 +1,1963 @@
+import logging%0Aimport unittest%0A%0Afrom eduid_common.api.testing import EduidAPITestCase%0Afrom eduid_common.session import EduidSession%0Afrom eduid_common.session.eduid_session import SessionFactory%0Afrom eduid_common.session.meta import SessionMeta%0Afrom eduid_common.session.redis_session import RedisEncryptedSession%0Afrom eduid_common.session.tests.test_eduid_session import SessionTestApp%0A%0Alogger = logging.getLogger(__name__)%0Alogger.setLevel(logging.DEBUG)%0A%0A%0Aclass TestIdPNamespace(EduidAPITestCase):%0A    def load_app(self, config):%0A        %22%22%22%0A        Called from the parent class, so we can provide the appropriate flask%0A        app for this test case.%0A        %22%22%22%0A        logger.debug('Starting SessionTestApp')%0A        app = SessionTestApp('testing', config)%0A        logger.debug('Started SessionTestApp')%0A        app.session_interface = SessionFactory(app.config)%0A        return app%0A%0A    def test_to_dict_from_dict(self):%0A%0A        # _config = %7B'secret_key': 'testing'%7D%0A        # app = SessionTestApp(name='namespace-tests', config=_config)%0A        meta = SessionMeta.new(app_secret='secret')%0A        base_session = self.app.session_interface.manager.get_session(meta=meta, new=True)%0A        session = EduidSession(app=self.app, meta=meta, base_session=base_session, new=True)%0A%0A        assert session.idp.sso_cookie_val is None%0A%0A        session.idp.sso_cookie_val = 'abc'%0A        session.signup.email_verification_code = 'test'%0A%0A        session._serialize_namespaces()%0A        out = session._session.to_dict()%0A%0A        assert out == %7B'_idp': %7B'sso_cookie_val': 'abc', 'ts': None%7D,%0A                       '_signup': %7B'email_verification_code': 'test', 'ts': None%7D%7D%0A%0A        session.persist()%0A%0A        # Validate that the session can be loaded again%0A        loaded_session = self.app.session_interface.manager.get_session(meta=meta, new=False)%0A        # ...and that it serialises to the same data that was persisted%0A        assert loaded_session.to_dict() == out%0A

add simple test for idp namespace