def _extract_task_instance_and_path(context, file_path): key = file_path.split(':', 1) try: if (len(key) == 1): return (None, key[0]) # No jobkey specified return (parse_task_instance_key(key[0]), key[1]) except ArgumentTypeError as e: raise context.CommandError(EXIT_INVALID_PARAMETER, str(e))
def _extract_task_instance_and_path(context, file_path): key = file_path.split(':', 1) try: if (len(key) == 1): return (None, key[0]) # No jobkey specified return (parse_task_instance_key(key[0]), key[1]) except ArgumentTypeError as e: raise context.CommandError(EXIT_INVALID_PARAMETER, str(e))
def test_parse_task_instance_key_fails_on_range(self): with pytest.raises(ArgumentTypeError): parse_task_instance_key("cluster/role/env/name/0-5")
def test_parse_task_instance_key_missing_instance(self): with pytest.raises(ArgumentTypeError): parse_task_instance_key("cluster/role/env/name")
def test_parse_task_instance_key_fails_on_range(self): with pytest.raises(ArgumentTypeError): parse_task_instance_key("cluster/role/env/name/0-5")
def test_parse_task_instance_key_missing_instance(self): with pytest.raises(ArgumentTypeError): parse_task_instance_key("cluster/role/env/name")