Beispiel #1
0
 def set_authentication_result(self, result):
     if result is None:
         Session.__dict__['_Session__shared_state']\
                 ['_Session__authentication_instance'] = None
     else:
         mock_auth = mock.create_autospec(BluebirdAuthentication)
         mock_auth.authenticate.return_value = result
         Session.set_authentication_instance(mock_auth)
Beispiel #2
0
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Author Jan Löser <*****@*****.**>
# Published under the GNU Public Licence 2
NAME = 'libvirt'

import os
TEMPLATES = os.path.dirname(__file__) + '/templates'

from rflibvirt.views import module
from rflibvirt.authentication import *
from bluebird.server.sessions.models import Session

Session.set_authentication_instance(LocalUser())
def test_session_instance():
    """Borg shall return same data."""
    instance1 = Session()
    instance2 = Session()
    assert instance1.__dict__ == instance2.__dict__
def test_get_timeout():
    assert Session.get_timeout() == Session._Session__session_timeout_min
Beispiel #5
0
def show_sessionservice():
    return render_template('sessions/SessionService.1.0.0.json',
                           state='enabled',
                           health='OK',
                           session_timeout=Session.get_timeout())
def session():
    return Session()
Beispiel #7
0
def show_session_collection():
    return render_template('sessions/SessionCollection.json',
                           sessions=Session.get_sessions())
Beispiel #8
0
def set_session_object():
    """Set session object for current request"""
    g.session = Session()
Beispiel #9
0
def show_sessionservice():
    return render_template('sessions/SessionService.1.0.0.json',
            state='enabled',
            health='OK',
            session_timeout=Session.get_timeout()
    )
Beispiel #10
0
def show_session_collection():
    return render_template('sessions/SessionCollection.json',
            sessions=Session.get_sessions()
    )
Beispiel #11
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author Jan Löser <*****@*****.**>
# Published under the GNU Public Licence 2
NAME = "libvirt"

import os

TEMPLATES = os.path.dirname(__file__) + "/templates"

from rflibvirt.views import module
from rflibvirt.authentication import *
from bluebird.server.sessions.models import Session

Session.set_authentication_instance(LocalUser())