-
Notifications
You must be signed in to change notification settings - Fork 36
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
Testcases for template #171
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool that you wrote a test for it too. I assume it works as intended. It is your decision whether or not to include the type in the review.
@@ -171,10 +171,10 @@ def _get_config(): | |||
return config | |||
|
|||
@staticmethod | |||
def get_processed_meter_value(meter_data: dict, value: str, default_value: any, factor: int = 1) -> any: | |||
def get_processed_meter_value(meter_data: dict, path_to_value, default_value: any, factor: int = 1) -> any: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove the type?
def get_processed_meter_value(meter_data: dict, path_to_value, default_value: any, factor: int = 1) -> any: | |
def get_processed_meter_value(meter_data: dict, path_to_value: str, default_value: any, factor: int = 1) -> any: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because this is actually not a string - it is an array of strings. But not always... So the "str" here is more confusing than helping
We should clean this up...
@@ -484,7 +484,7 @@ def fetch_url(self, url, try_number=1): | |||
else: | |||
raise | |||
|
|||
def _get_data(self): | |||
def _get_data(self) -> dict: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice!
add tests for template and add docu for path in json