コード例 #1
0
ファイル: test_constructs.py プロジェクト: Xion/taipan
 def test_do__function(self):
     retval = __unit__.with_(self._contextmanager(self.VALUE),
                             do=self.RETURN)
     self.assertEquals(self.VALUE, retval)
コード例 #2
0
ファイル: test_constructs.py プロジェクト: Xion/taipan
 def test_do__some_object(self):
     with self.assertRaises(TypeError):
         __unit__.with_(self._contextmanager(), object())
コード例 #3
0
ファイル: test_constructs.py プロジェクト: Xion/taipan
 def test_do__pass(self):
     __unit__.with_(self._contextmanager(), do=__unit__.pass_())
コード例 #4
0
ファイル: test_constructs.py プロジェクト: Xion/taipan
 def test_contextmanager__invalid_object(self):
     with self.assertRaises(TypeError):
         __unit__.with_(object(), self.RETURN)
コード例 #5
0
ファイル: test_constructs.py プロジェクト: Xion/taipan
 def test_do__none(self):
     with self.assertRaises(TypeError):
         __unit__.with_(self._contextmanager(), None)
コード例 #6
0
ファイル: test_constructs.py プロジェクト: movermeyer/taipan
 def test_do__function(self):
     retval = __unit__.with_(self._contextmanager(self.VALUE),
                             do=self.RETURN)
     self.assertEquals(self.VALUE, retval)
コード例 #7
0
ファイル: test_constructs.py プロジェクト: Xion/taipan
 def test_contextmanager__none(self):
     with self.assertRaises(TypeError):
         __unit__.with_(None, self.RETURN)
コード例 #8
0
ファイル: test_constructs.py プロジェクト: movermeyer/taipan
 def test_do__pass(self):
     __unit__.with_(self._contextmanager(), do=__unit__.pass_())
コード例 #9
0
ファイル: test_constructs.py プロジェクト: movermeyer/taipan
 def test_do__some_object(self):
     with self.assertRaises(TypeError):
         __unit__.with_(self._contextmanager(), object())
コード例 #10
0
ファイル: test_constructs.py プロジェクト: movermeyer/taipan
 def test_do__none(self):
     with self.assertRaises(TypeError):
         __unit__.with_(self._contextmanager(), None)
コード例 #11
0
ファイル: test_constructs.py プロジェクト: movermeyer/taipan
 def test_contextmanager__invalid_object(self):
     with self.assertRaises(TypeError):
         __unit__.with_(object(), self.RETURN)
コード例 #12
0
ファイル: test_constructs.py プロジェクト: movermeyer/taipan
 def test_contextmanager__none(self):
     with self.assertRaises(TypeError):
         __unit__.with_(None, self.RETURN)