Test added for get_asset_sensor_readings_stats_q_limit
@@ -348,7 +348,25 @@ class TestBrowseAssets:
assert retval[sensor_code_1]['average'] == sum(self.test_data_x_val_list[1:-1])/len(self.test_data_x_val_list[1:-1])
assert retval[sensor_code_1]['max'] == max(self.test_data_x_val_list[1:-1])
+ @pytest.mark.xfail(reason="FOGL-546, FOGL-548")
async def test_get_asset_sensor_readings_stats_q_limit(self):
+ """
+ Verify that if more than 20 readings, limited readings summary for a sensor value are returned when querying with limit
+ http://localhost:8082/foglamp/asset/TESTAPI/x/summary?limit=1
+ """
+ conn = http.client.HTTPConnection(BASE_URL)
+ conn.request("GET", '/foglamp/asset/{}/{}/summary?limit={}'.format(test_data_asset_code, sensor_code_1, 1))
+ r = conn.getresponse()
+ assert 200 == r.status
+ r = r.read().decode()
+ conn.close()
+ retval = json.loads(r)
+ assert 1 == len(retval)
+ assert retval[sensor_code_1]['min'] == self.test_data_x_val_list[-1]
+ assert retval[sensor_code_1]['average'] == self.test_data_x_val_list[-1]
+ assert retval[sensor_code_1]['max'] == self.test_data_x_val_list[-1]
+
+ async def test_get_asset_sensor_readings_stats_q_sec(self):
pass
async def test_get_asset_sensor_readings_stats_q_min(self):
@@ -357,7 +375,7 @@ class TestBrowseAssets:
async def test_get_asset_sensor_readings_stats_q_hrs(self):
pass
- async def test_get_asset_sensor_readings_stats_q_time(self):
+ async def test_get_asset_sensor_readings_stats_q_time_complex(self):
pass
async def test_get_asset_sensor_readings_time_avg(self):
