Skip to content

Refactor configSettings class to remove test specific code #2678

@DonJayamanne

Description

@DonJayamanne

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.

Metadata

Metadata

Assignees

Labels

debtCode quality issues

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions