def test_help(self): '''Just make sure that help doesn't blow up on us''' shovel = Shovel.load('test/examples/overrides/', 'test/examples/overrides/') _, tasks = zip(*shovel.items()) self.assertGreater(len(tasks), 0) for task in tasks: self.assertNotEqual(task.help(), '')
def shovel_help(shovel, *names): '''Return a string about help with the tasks, or lists tasks available''' # If names are provided, and the name refers to a group of tasks, print out # the tasks and a brief docstring. Otherwise, just enumerate all the tasks # available if not len(names): return heirarchical_help(shovel, '') else: for name in names: task = shovel[name] if isinstance(task, Shovel): return heirarchical_help(task, name) else: return task.help()