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

Refactor configSettings class to remove test specific code #2678

Closed
DonJayamanne opened this issue Sep 25, 2018 · 0 comments
Closed

Refactor configSettings class to remove test specific code #2678

DonJayamanne opened this issue Sep 25, 2018 · 0 comments
Assignees
Labels
debt Covers everything internal: CI, testing, refactoring of the codebase, etc.

Comments

@DonJayamanne
Copy link

DonJayamanne commented Sep 25, 2018

In PR #2669 we have added that's test specific code, we should avoid writing such code. We have done this in a few places and i think its a bad habit, I believe we should take the time to re-structure the code where necessary.

Its an indication that code needs to be refactored for testability.

Solution:

  • Create a method initialize
  • Move the code thats inside the if condition in the constructor into the initialize method
  • For testing purposes, create a subclass of the PythonSettings class, override the initialize method.
@DonJayamanne DonJayamanne added needs PR debt Covers everything internal: CI, testing, refactoring of the codebase, etc. important Issue identified as high-priority and removed important Issue identified as high-priority labels Sep 25, 2018
@DonJayamanne DonJayamanne self-assigned this Oct 3, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Nov 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debt Covers everything internal: CI, testing, refactoring of the codebase, etc.
Projects
None yet
Development

No branches or pull requests

2 participants