def test_do__function(self): retval = __unit__.with_(self._contextmanager(self.VALUE), do=self.RETURN) self.assertEquals(self.VALUE, retval)
def test_do__some_object(self): with self.assertRaises(TypeError): __unit__.with_(self._contextmanager(), object())
def test_do__pass(self): __unit__.with_(self._contextmanager(), do=__unit__.pass_())
def test_contextmanager__invalid_object(self): with self.assertRaises(TypeError): __unit__.with_(object(), self.RETURN)
def test_do__none(self): with self.assertRaises(TypeError): __unit__.with_(self._contextmanager(), None)
def test_contextmanager__none(self): with self.assertRaises(TypeError): __unit__.with_(None, self.RETURN)