Skip to content

Instantly share code, notes, and snippets.

@jay-zhuang
Last active December 16, 2015 05:39
Show Gist options
  • Save jay-zhuang/5385516 to your computer and use it in GitHub Desktop.
Save jay-zhuang/5385516 to your computer and use it in GitHub Desktop.
# overrider the class functions for test only
MyClass.ConnectServer = lambda *a, **kw: None
# simple lambda functions to override real function
def test_connection():
run_connection_fun(lambda: False)
run_connection_fun(lambda: True)
def run_connection_fun(connect_fun)
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment