예제 #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'
예제 #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'
예제 #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
예제 #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
예제 #5
0
 def test_missing_exists_implementation(self):
     session = StorageMixin()
     session._exists()
예제 #6
0
 def test_missing_destroy_implementation(self):
     session = StorageMixin()
     session._destroy()
예제 #7
0
 def test_missing_save_implementation(self):
     session = StorageMixin()
     session._save()
예제 #8
0
 def test_missing_load_implementation(self):
     session = StorageMixin()
     session._load()
예제 #9
0
 def test_missing_exists_implementation(self):
     with raises(Exception):
         session = StorageMixin()
         session._exists()
예제 #10
0
 def test_missing_destroy_implementation(self):
     with raises(Exception):
         session = StorageMixin()
         session._destroy()
예제 #11
0
 def test_missing_save_implementation(self):
     with raises(Exception):
         session = StorageMixin()
         session._save()
예제 #12
0
 def test_missing_exists_implementation(self):
     session = StorageMixin()
     session._exists()
예제 #13
0
 def test_missing_destroy_implementation(self):
     session = StorageMixin()
     session._destroy()
예제 #14
0
 def test_missing_save_implementation(self):
     session = StorageMixin()
     session._save()
예제 #15
0
 def test_missing_load_implementation(self):
     session = StorageMixin()
     session._load()
예제 #16
0
 def test_data(self):
     session = StorageMixin()
     assert session.data is None