コード例 #1
0
ファイル: test_base.py プロジェクト: pombredanne/launchpad-3
 def test_interaction(self):
     # The WorkingBase.interaction context manager will begin an
     # interaction on entry and end it on exit.
     base = WorkingBase()
     base.init(self.email, transaction.manager, self.logger)
     endInteraction()
     self.assertIs(None, queryInteraction())
     with base.interaction:
         self.assertIsNot(None, queryInteraction())
     self.assertIs(None, queryInteraction())
コード例 #2
0
ファイル: test_base.py プロジェクト: vitaminmoo/unnaturalcode
 def test_interaction(self):
     # The WorkingBase.interaction context manager will begin an
     # interaction on entry and end it on exit.
     base = WorkingBase()
     base.init(self.email, transaction.manager, self.logger)
     endInteraction()
     self.assertIs(None, queryInteraction())
     with base.interaction:
         self.assertIsNot(None, queryInteraction())
     self.assertIs(None, queryInteraction())
コード例 #3
0
ファイル: test_base.py プロジェクト: pombredanne/launchpad-3
 def test_interaction_nested(self):
     # If an interaction is already in progress, the interaction
     # context manager will not begin a new interaction on entry,
     # nor will it end the interaction on exit.
     base = WorkingBase()
     base.init(self.email, transaction.manager, self.logger)
     endInteraction()
     self.assertIs(None, queryInteraction())
     with base.interaction:
         self.assertIsNot(None, queryInteraction())
         with base.interaction:
             self.assertIsNot(None, queryInteraction())
         self.assertIsNot(None, queryInteraction())
     self.assertIs(None, queryInteraction())
コード例 #4
0
ファイル: test_base.py プロジェクト: vitaminmoo/unnaturalcode
 def test_interaction_nested(self):
     # If an interaction is already in progress, the interaction
     # context manager will not begin a new interaction on entry,
     # nor will it end the interaction on exit.
     base = WorkingBase()
     base.init(self.email, transaction.manager, self.logger)
     endInteraction()
     self.assertIs(None, queryInteraction())
     with base.interaction:
         self.assertIsNot(None, queryInteraction())
         with base.interaction:
             self.assertIsNot(None, queryInteraction())
         self.assertIsNot(None, queryInteraction())
     self.assertIs(None, queryInteraction())