Skip to content

Commit

Permalink
Rename contrib session classes
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaur Nasibov committed Jun 25, 2013
1 parent 191a13d commit e3369f3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions kaylee/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def restore(self, node, result):
KL_LOADER_DEFAULT_SESSION_DATA_MANAGER = PhonySessionDataManager


class NodeSessionDataManager(SessionDataManager):
class ServerSessionDataManager(SessionDataManager):
"""A session data manager, which keeps the data in
:attr:`Node.session_data`."""
def store(self, node, task):
Expand All @@ -132,7 +132,7 @@ def restore(self, node, result):
result.update(session_data)


class JSONSessionDataManager(SessionDataManager):
class ClientSessionDataManager(SessionDataManager):
"""Stores encrypted session variables in task and restores them
from the results. For example, the following task data::
Expand Down
8 changes: 4 additions & 4 deletions kaylee/testsuite/session_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from kaylee.testsuite import KayleeTest, load_tests
from kaylee.node import Node, NodeID
from kaylee import KayleeError
from kaylee.session import (_encrypt, _decrypt, JSONSessionDataManager,
NodeSessionDataManager, PhonySessionDataManager,
from kaylee.session import (_encrypt, _decrypt, ClientSessionDataManager,
ServerSessionDataManager, PhonySessionDataManager,
SESSION_DATA_ATTRIBUTE,
SessionDataManager,)
from kaylee.errors import SessionKeyNameError
Expand Down Expand Up @@ -49,7 +49,7 @@ def test_node_session_data_manager(self):
'#s2' : [1, 2, 3],
}

nsdm = NodeSessionDataManager()
nsdm = ServerSessionDataManager()
self.assertIsNone(node.session_data)
nsdm.store(node, task)
self.assertIsNotNone(node.session_data)
Expand Down Expand Up @@ -89,7 +89,7 @@ def test_json_session_data_manager(self):
'#s2' : [1, 2, 3],
}

jsdm = JSONSessionDataManager(secret_key='abc')
jsdm = ClientSessionDataManager(secret_key='abc')
jsdm.store(node, task)
self.assertIn(SESSION_DATA_ATTRIBUTE, task)
self.assertEqual(task['id'], 'i1')
Expand Down

0 comments on commit e3369f3

Please sign in to comment.