def setUp(self): global hello hello = reload(hello) self.foo = UIMock() self.bar = UIMock() hello.register_ui('foo')(self.foo) hello.register_ui('bar')(self.bar) hello.message('foo', "message using the foo UI") hello.message('foo', "another message using foo") hello.message('bar', "message using the bar UI")
import hello print hello.message('C') print hello.message('module ' + hello.__file__) for i in range(3): print hello.message(str(i))
"import and use a C extension library module" import hello print(hello.message('C')) print(hello.message('module ' + hello.__file__)) for i in range(3): reply = hello.message(str(i)) print(reply)
""" import and use a C extension library module www.moguf.com 2016-05-28 """ import hello print(hello.message('C')) print(hello.message('module ' + hello.__file__))
def function_handler(event, context): return message()