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
398 Support optional "source" in /sensors/data [GET] #543
Conversation
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Pull Request Test Coverage Report for Build 3600176789
💛 - Coveralls |
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
…rsion) Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
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.
Great, also that you added a test for a crucial endpoint which wasn't covered before
One of my comments might make the test somewhat faster, I believe it should live in another module.
@@ -50,3 +55,36 @@ def test_post_sensor_data( | |||
assert len(beliefs) == expected_num_values | |||
# check that values are scaled to the sensor unit correctly | |||
assert pytest.approx(beliefs[0].event_value - expected_value) == 0 | |||
|
|||
|
|||
def test_get_sensor_data( |
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.
I believe this could be in the non-fresh part of testing, as the test itself mutates no data. And you added the data points in both versions.
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.
I first implemented it in the non-fresh db test module, but it did interfere there. And I found it was tricky. trickier than just adapting the assert statements that check the number of beliefs registered on the sensor shared by these tests. [That was actually only an issue in the fresh db test module]
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Allow to filter requests for sensor data by data source. Users can find out relevant source ids from chart tooltips.
Also fixes the return message of
/sensors/data [GET]
and the replacement of NaN values with null values in the returned JSON.