Skip to content

Comments

New functionality: adding commands of whole cli input length#2

Open
carlosrn98 wants to merge 1 commit intomasterfrom
command_functionality
Open

New functionality: adding commands of whole cli input length#2
carlosrn98 wants to merge 1 commit intomasterfrom
command_functionality

Conversation

@carlosrn98
Copy link

This new change, aside from making some small unrelated changes, adds the functionality needed for our use case of being able to add commands of the whole cli's input length. This means that we will be able to map certain input to any particular output, which hopefully will benefit our testing strategy.

"Function decorator to define a telnet command."
def __init__(self, names, hidden=False):
if type(names) is str:
def __init__(self, names, hidden=False, has_extra_logic=True):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what exactly is this extra logic?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I forgot to take that part out.

self.username = None
return True

def _get_cmd_method(self):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused on the usage for this though. Can't you just say if len(self.COMMANDS.alias) > 1, False, else True?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why .alias?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so you're trying to see if a command is an all_input_command vs the first input being the command followed by parameters, right? If the logic for the command input sets self.alias = [] (which it does on line 194), then can't you make the assumption that if length of alias is 0, it's an all_input_command?

This new change, aside from making some small unrelated changes, adds the
functionality needed for our use case of being able to add commands of the
whole cli's input length. This means that we will be able to map certain
input to any particular output, which hopefully will benefit our testing
strategy.
@carlosrn98 carlosrn98 force-pushed the command_functionality branch from 4ba78ef to 79bf68d Compare February 3, 2023 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants