1 from nose.tools import eq_
3 from ..cache import Cache
6 def test_session_manager():
7 cache = Cache(cutoff=2)
9 user_sessions = list(cache.process("foo", 1))
10 eq_(user_sessions, [])
12 user_sessions = list(cache.process("bar", 2))
13 eq_(user_sessions, [])
15 user_sessions = list(cache.process("foo", 2))
16 eq_(user_sessions, [])
18 user_sessions = list(cache.process("bar", 10))
19 eq_(len(user_sessions), 2)
21 user_sessions = list(cache.get_active_sessions())
22 eq_(len(user_sessions), 1)