示例#1
0
 def test_custom_function_wrapper(self):
     try:
         foo.function_that_takes_foo("yellow")
     except TypeError:
         self.fail()
     foo1 = foo.function_that_returns_foo()
     self.assertEqual(foo1.get_datum(), "yellow")
示例#2
0
 def test_custom_function_wrapper(self):
     try:
         foo.function_that_takes_foo("yellow")
     except TypeError:
         self.fail()
     foo1 = foo.function_that_returns_foo()
     self.assertEqual(foo1.get_datum(), "yellow")
示例#3
0
 def test_implicit_conversion_function_value(self):
     zoo1 = foo.Zoo("zpto")
     try:
         foo.function_that_takes_foo(zoo1)
     except TypeError:
         self.fail()
     foo1 = foo.function_that_returns_foo()
     self.assertEqual(foo1.get_datum(), "zpto")
 def test_implicit_conversion_function_value(self):
     zoo1 = foo.Zoo("zpto")
     try:
         foo.function_that_takes_foo(zoo1)
     except TypeError:
         self.fail()
     foo1 = foo.function_that_returns_foo()
     self.assertEqual(foo1.get_datum(), "zpto")
示例#5
0
    def test_custom_function_wrapper(self):
        try:
            foo.function_that_takes_foo("yellow")
        except TypeError:
            self.fail()
        foo1 = foo.function_that_returns_foo()
        self.assertEqual(foo1.get_datum(), "yellow")

        ## check that the wrapper gets a docstring
        self.assertEqual(foo.function_that_takes_foo.__doc__, "I'm awake you rascals!")
示例#6
0
    def test_custom_function_wrapper(self):
        try:
            foo.function_that_takes_foo("yellow")
        except TypeError:
            self.fail()
        foo1 = foo.function_that_returns_foo()
        self.assertEqual(foo1.get_datum(), "yellow")

        ## check that the wrapper gets a docstring
        self.assertEqual(foo.function_that_takes_foo.__doc__, "I'm awake you rascals!")