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