Skip to content

Instantly share code, notes, and snippets.

@nward
Created February 8, 2016 03:13
Show Gist options
  • Save nward/a931f38c5a8b34b8a1cd to your computer and use it in GitHub Desktop.
Save nward/a931f38c5a8b34b8a1cd to your computer and use it in GitHub Desktop.
Testing a collectd python module
def config_function(config=None):
# do something
pass
def init_function():
# do something
pass
if __name__ == '__main__':
class CollectdDummy:
def register_config(self,a):
# do something
pass
def register_init(self,a):
# do something
pass
def register_read(self,a,b):
# do something
pass
collectd = CollectdDummy()
else:
import collectd
collectd.register_config(config_function)
collectd.register_init(init_function)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment