コード例 #1
0
ファイル: test_context.py プロジェクト: benblake112/woodstove
 def test_ctx_get(self):
     c = {'foo': 'bar'}
     context.ctx_push(c)
     t = context.ctx_get()
     self.assertIs(t, c)
     self.assertGreater(len(bottle.request.ws_context), 0)
コード例 #2
0
ファイル: test_context.py プロジェクト: benblake112/woodstove
 def test_ctx_copy(self):
     c = {'foo': 'bar'}
     context.ctx_push(c)
     copy = context.ctx_copy()
     self.assertIsNot(copy[0], c)
     self.assertDictEqual(c, copy[0])
コード例 #3
0
ファイル: test_context.py プロジェクト: benblake112/woodstove
 def test_ctx_pop(self):
     c = {'foo': 'bar'}
     context.ctx_push(c)
     self.assertIs(context.ctx_pop(), c)
     self.assertEqual(len(bottle.request.ws_context), 0)