Exemplo n.º 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")
Exemplo n.º 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")
Exemplo n.º 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")
Exemplo n.º 4
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")
Exemplo n.º 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!")
Exemplo n.º 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!")