Example #1
0
def full_debug(ctx, **kwargs):
    """Execute all debug routines, executed by default."""
    acts = wa_actions.get_all_actions()

    debug_implementation(
        acts,
        json_output=ctx.obj.get('json', False),
        opt_out=ctx.obj.get('opt_out', False),
    )
Example #2
0
 def test_user_facing_descriptions(self):
     actions = wa_actions.get_all_actions()
     for action in actions:
         result = re.search(r"[^\w_]", action.user_facing_name)
         assert not result, (
             "Action {} user_facing_name is invalid.\n"
             "Use only letters and underscores.\nName found: {}".format(
                 action.__name__, action.user_facing_name))
     pass
Example #3
0
def test_user_facing_descriptions():
    actions = wa_actions.get_all_actions()
    for action in actions:
        result = re.search(r'[^\w_]', action.user_facing_name)
        assert not result, 'Action {} user_facing_name is invalid.\n' \
            'Use only letters and underscores.\nName found: {}'.format(
                action.__name__,
                action.user_facing_name
            )
    pass
Example #4
0
def ls(ctx, **kwargs):
    """Print a list of possible debug actions."""
    acts = wa_actions.get_all_actions()
    if ctx.obj.get("json", False):
        click.echo(json.dumps({"actions": [act.user_facing_name for act in acts]}))
        return

    click.secho("{:<20}  {}".format("Action", "Description"), bold=True)
    for act in acts:
        click.secho("{:<20}  {}".format(act.user_facing_name, act.short_description))
    click.echo()