Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated the class instance prefix to be more definitive #146

Merged
merged 4 commits into from Jan 13, 2022

Conversation

kmadisa
Copy link
Contributor

@kmadisa kmadisa commented Dec 4, 2021

When the startswith method is called with the prefix 'Sim' it resulted to True for 'SimControl'. This results in the action handlers in sim_actions not getting overridden with the correct action_handler as it is not defined in the provided 'SimControl' class.
This is why only one of the devices' commands where getting overridden.

I also added a test just to make sure that we can execute commands in both the simulator and the simulator controller.

Signed-off-by: Katleho Madisa katleho.madisa47@gmail.com

Screenshots or code snippets (if appropriate):

  • N/A

Definition of Done Checklist

  • Code meets our python style guidelines?
  • Unit tested (coded, passed, included)?
  • Requested at least 2 reviewers?
  • Commented code, particularly in hard-to-understand areas?
  • Made corresponding changes to the documentation (e.g. Python documentation, System Engineering Documentation, version description updates, README file, etc)?

JIRA: N/A

When the startswith method is called with the  prefix 'Sim' it resulted to true for 'SimControl'. This results in the sim_actions
not getting overriden with the correct action_handler as it is not defined in the provided 'SimControl' class.
This is why only one of the devices' commands where getting overriden.

Signed-off-by: Katleho Madisa <katleho.madisa47@gmail.com>
This is just to ensure that commands in both the sim device and the sim control device get overridden, respectively.

Signed-off-by: Katleho Madisa <katleho.madisa47@gmail.com>
Signed-off-by: Katleho Madisa <katleho.madisa47@gmail.com>
This is to ensure that we only get the class instance for simulator device.

Signed-off-by: Katleho Madisa <katleho.madisa47@gmail.com>
@kmadisa kmadisa marked this pull request as ready for review December 6, 2021 20:10
@kmadisa kmadisa merged commit aaa6ffb into master Jan 13, 2022
@kmadisa kmadisa deleted the user/kmadisa/Fix-command-overriding-bug branch January 13, 2022 08:19
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.

Commands overriding in sim device and control device seem to be mutually exclusive, respectively
2 participants