def test_ten(): """make sure it generates 10 excuses if asked""" assert(len(bofh_excuse(how_many=10)) == 10)
def test_single(): """make sure it generates a single excuse by default""" assert(len(bofh_excuse()) == 1)
#!/usr/bin/env python import sys print("Example using bofhexcuse python module, packaged with this asset") print("\nHere's the current module search path") print(sys.path) print("\nCalling bofhexcuse.bofh_excuse:") print( "This should return without error when called using wrapper script in asset's bin/" ) print( "This should return with error when called directly from asset's libexec/") import bofhexcuse print(bofhexcuse.bofh_excuse()[0])
def main(): for excuse in bofh_excuse(how_many=1): print 'ABORTING, LOG READS AS FOLLOWS:' print '> ERROR:' print '> {0}'.format(excuse) print 'Please investigate!\n'
def bofh(self, msg, args): """ print random BOFH quote """ return "The cause of the problem is: *{}*".format(bofh_excuse()[0])