Ejemplo n.º 1
0
 def test_create(self):
     session = StorageMixin(id=123, timeout=30, autosave=False)
     session['test'] = 'blah'
     assert session.timeout == 30
     assert session.autosave is False
     assert session.id == 123
     assert repr(session) == '<watson.http.sessions.abc.StorageMixin id:123>'
     assert session['test'] == 'blah'
     assert session.get('test') == 'blah'
Ejemplo n.º 2
0
 def test_create(self):
     session = StorageMixin(id=123, timeout=30, autosave=False)
     session['test'] = 'blah'
     assert session.timeout == 30
     assert session.autosave is False
     assert session.id == 123
     assert repr(
         session) == '<watson.http.sessions.abc.StorageMixin id:123>'
     assert session['test'] == 'blah'
     assert session.get('test') == 'blah'
Ejemplo n.º 3
0
 def test_cookie_params(self):
     session = StorageMixin()
     params = {
         'expires': 0,
         'path': '/',
         'domain': None,
         'secure': False,
         'httponly': True,
         'comment': 'Watson session id'
     }
     session.cookie_params = params
     assert session.cookie_params == params
Ejemplo n.º 4
0
 def test_cookie_params(self):
     session = StorageMixin()
     params = {
         'expires': 0,
         'path': '/',
         'domain': None,
         'secure': False,
         'httponly': True,
         'comment': 'Watson session id'
     }
     session.cookie_params = params
     assert session.cookie_params == params
Ejemplo n.º 5
0
 def test_missing_exists_implementation(self):
     session = StorageMixin()
     session._exists()
Ejemplo n.º 6
0
 def test_missing_destroy_implementation(self):
     session = StorageMixin()
     session._destroy()
Ejemplo n.º 7
0
 def test_missing_save_implementation(self):
     session = StorageMixin()
     session._save()
Ejemplo n.º 8
0
 def test_missing_load_implementation(self):
     session = StorageMixin()
     session._load()
Ejemplo n.º 9
0
 def test_missing_exists_implementation(self):
     with raises(Exception):
         session = StorageMixin()
         session._exists()
Ejemplo n.º 10
0
 def test_missing_destroy_implementation(self):
     with raises(Exception):
         session = StorageMixin()
         session._destroy()
Ejemplo n.º 11
0
 def test_missing_save_implementation(self):
     with raises(Exception):
         session = StorageMixin()
         session._save()
Ejemplo n.º 12
0
 def test_missing_exists_implementation(self):
     session = StorageMixin()
     session._exists()
Ejemplo n.º 13
0
 def test_missing_destroy_implementation(self):
     session = StorageMixin()
     session._destroy()
Ejemplo n.º 14
0
 def test_missing_save_implementation(self):
     session = StorageMixin()
     session._save()
Ejemplo n.º 15
0
 def test_missing_load_implementation(self):
     session = StorageMixin()
     session._load()
Ejemplo n.º 16
0
 def test_data(self):
     session = StorageMixin()
     assert session.data is None