Test added for get_asset_sensor_readings_q_limit
@@ -235,8 +235,22 @@ class TestBrowseAssets:
retval = json.loads(r)
assert 20 == len(retval)
+ @pytest.mark.xfail(reason="FOGL-545")
async def test_get_asset_sensor_readings_q_limit(self):
- pass
+ """
+ Verify that if more than 20 readings, limited readings for a sensor value are returned when querying with limit
+ http://localhost:8082/foglamp/asset/TESTAPI/x?limit=1
+ """
+ conn = http.client.HTTPConnection(BASE_URL)
+ conn.request("GET", '/foglamp/asset/{}/{}?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[0][sensor_code_1] == self.test_data_x_val_list[-1]
+ assert retval[0]['timestamp'] == self.test_data_ts_list[-1]
async def test_get_asset_sensor_readings_q_min(self):
pass
