def test_prepare_options_with_id(self): self.assertEqual(["a=b", "c=d", '(id:some_id)'], console_report.prepare_options({ "c": "d", "a": "b", "id": "some_id" }))
def test_prepare_options_without_id(self): self.assertEqual( ["a=b", "c=d"], console_report.prepare_options( {"c": "d", "a": "b", "id":"some_id"}, with_id=False ) )
def test_prepare_options_without_id(self): self.assertEqual(["a=b", "c=d"], console_report.prepare_options( { "c": "d", "a": "b", "id": "some_id" }, with_id=False))
def constraint_plain(constraint_info, with_id=False): """ dict constraint_info see constraint in pcs/lib/exchange_formats.md bool with_id have to show id with options_dict """ options = constraint_info["options"] role = options.get("rsc-role", "") role_prefix = "{0} ".format(role) if role else "" return role_prefix + " ".join([options.get("rsc", "")] + prepare_options( dict((name, value) for name, value in options.items() if name not in ["rsc-role", "rsc"]), with_id))
def constraint_plain(constraint_info, with_id=False): """ dict constraint_info see constraint in pcs/lib/exchange_formats.md bool with_id have to show id with options_dict """ options = constraint_info["options"] role = options.get("rsc-role", "") role_prefix = "{0} ".format(role) if role else "" return role_prefix + " ".join([options.get("rsc", "")] + prepare_options( dict( (name, value) for name, value in options.items() if name not in ["rsc-role", "rsc"] ), with_id ))
def test_prepare_options_with_id(self): self.assertEqual( ["a=b", "c=d", '(id:some_id)'], console_report.prepare_options({"c": "d", "a": "b", "id":"some_id"}) )