Пример #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)