def test_padlist(self): self.assertListEqual(utils.padlist(["George", "Costanza", "NYC"], 3), ["George", "Costanza", "NYC"]) self.assertListEqual(utils.padlist(["George", "Costanza"], 3), ["George", "Costanza", None]) self.assertListEqual(utils.padlist(["George", "Costanza", "NYC"], 4, default="Earth"), ["George", "Costanza", "NYC", "Earth"])
def test_padlist(self): self.assertListEqual(utils.padlist(["George", "Costanza", "NYC"], 3), ["George", "Costanza", "NYC"]) self.assertListEqual(utils.padlist(["George", "Costanza"], 3), ["George", "Costanza", None]) self.assertListEqual( utils.padlist(["George", "Costanza", "NYC"], 4, default="Earth"), ["George", "Costanza", "NYC", "Earth"])
def format_signature(self): return " ".join(self.format_arg(*padlist(list(arg), 3)) for arg in self.args)
def apply_part(self, arglist, taskset_id, publisher): args, kwargs, opts = padlist(arglist, 3, default={}) return apply_async(self.task, args, kwargs, taskset_id=taskset_id, publisher=publisher, **opts)
def apply_part(self, arglist, taskset_id, publisher): """Apply a single part of the taskset.""" args, kwargs, opts = padlist(arglist, 3, default={}) return apply_async(self.task, args, kwargs, taskset_id=taskset_id, publisher=publisher, **opts)