Beispiel #1
0
 def test_renewing_fs_session(self):
     store = FilesystemSessionStore(self.session_folder, renew_missing=True)
     x = store.new()
     store.save(x)
     store.delete(x)
     x2 = store.get(x.sid)
     assert x2.new
Beispiel #2
0
def test_renewing_fs_session(tmpdir):
    store = FilesystemSessionStore(str(tmpdir), renew_missing=True)
    x = store.new()
    store.save(x)
    store.delete(x)
    x2 = store.get(x.sid)
    assert x2.new
Beispiel #3
0
def test_basic_fs_sessions():
    """Test basic file system sessions"""
    store = FilesystemSessionStore(session_folder)
    x = store.new()
    assert x.new
    assert not x.modified
    x['foo'] = [1, 2, 3]
    assert x.modified
    store.save(x)

    x2 = store.get(x.sid)
    assert not x2.new
    assert not x2.modified
    assert x2 is not x
    assert x2 == x
    x2['test'] = 3
    assert x2.modified
    assert not x2.new
    store.save(x2)

    x = store.get(x.sid)
    store.delete(x)
    x2 = store.get(x.sid)
    # the session is not new when it was used previously.
    assert not x2.new
Beispiel #4
0
 def test_renewing_fs_session(self):
     store = FilesystemSessionStore(self.session_folder, renew_missing=True)
     x = store.new()
     store.save(x)
     store.delete(x)
     x2 = store.get(x.sid)
     assert x2.new
Beispiel #5
0
def test_basic_fs_sessions():
    """Test basic file system sessions"""
    store = FilesystemSessionStore(session_folder)
    x = store.new()
    assert x.new
    assert not x.modified
    x['foo'] = [1, 2, 3]
    assert x.modified
    store.save(x)

    x2 = store.get(x.sid)
    assert not x2.new
    assert not x2.modified
    assert x2 is not x
    assert x2 == x
    x2['test'] = 3
    assert x2.modified
    assert not x2.new
    store.save(x2)

    x = store.get(x.sid)
    store.delete(x)
    x2 = store.get(x.sid)
    # the session is not new when it was used previously.
    assert not x2.new
    def test_basic_fs_sessions(self):
        store = FilesystemSessionStore(self.session_folder)
        x = store.new()
        assert x.new
        assert not x.modified
        x["foo"] = [1, 2, 3]
        assert x.modified
        store.save(x)

        x2 = store.get(x.sid)
        assert not x2.new
        assert not x2.modified
        assert x2 is not x
        assert x2 == x
        x2["test"] = 3
        assert x2.modified
        assert not x2.new
        store.save(x2)

        x = store.get(x.sid)
        store.delete(x)
        x2 = store.get(x.sid)
        # the session is not new when it was used previously.
        assert not x2.new
Beispiel #7
0
def test_basic_fs_sessions(tmpdir):
    store = FilesystemSessionStore(str(tmpdir))
    x = store.new()
    assert x.new
    assert not x.modified
    x["foo"] = [1, 2, 3]
    assert x.modified
    store.save(x)

    x2 = store.get(x.sid)
    assert not x2.new
    assert not x2.modified
    assert x2 is not x
    assert x2 == x
    x2["test"] = 3
    assert x2.modified
    assert not x2.new
    store.save(x2)

    x = store.get(x.sid)
    store.delete(x)
    x2 = store.get(x.sid)
    # the session is not new when it was used previously.
    assert not x2.new