예제 #1
0
 def test_do__function(self):
     retval = __unit__.with_(self._contextmanager(self.VALUE),
                             do=self.RETURN)
     self.assertEquals(self.VALUE, retval)
예제 #2
0
 def test_do__some_object(self):
     with self.assertRaises(TypeError):
         __unit__.with_(self._contextmanager(), object())
예제 #3
0
 def test_do__pass(self):
     __unit__.with_(self._contextmanager(), do=__unit__.pass_())
예제 #4
0
 def test_contextmanager__invalid_object(self):
     with self.assertRaises(TypeError):
         __unit__.with_(object(), self.RETURN)
예제 #5
0
 def test_do__none(self):
     with self.assertRaises(TypeError):
         __unit__.with_(self._contextmanager(), None)
예제 #6
0
 def test_do__function(self):
     retval = __unit__.with_(self._contextmanager(self.VALUE),
                             do=self.RETURN)
     self.assertEquals(self.VALUE, retval)
예제 #7
0
 def test_contextmanager__none(self):
     with self.assertRaises(TypeError):
         __unit__.with_(None, self.RETURN)
예제 #8
0
 def test_do__pass(self):
     __unit__.with_(self._contextmanager(), do=__unit__.pass_())
예제 #9
0
 def test_do__some_object(self):
     with self.assertRaises(TypeError):
         __unit__.with_(self._contextmanager(), object())
예제 #10
0
 def test_do__none(self):
     with self.assertRaises(TypeError):
         __unit__.with_(self._contextmanager(), None)
예제 #11
0
 def test_contextmanager__invalid_object(self):
     with self.assertRaises(TypeError):
         __unit__.with_(object(), self.RETURN)
예제 #12
0
 def test_contextmanager__none(self):
     with self.assertRaises(TypeError):
         __unit__.with_(None, self.RETURN)