From 821656ffc87318b841d852e509568a09eb0342c3 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 25 Nov 2020 15:55:47 +0100 Subject: [PATCH] fixed new version of metrics for second_hdd test --- tests/test_metrics.py | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/tests/test_metrics.py b/tests/test_metrics.py index b976d28f..49874582 100644 --- a/tests/test_metrics.py +++ b/tests/test_metrics.py @@ -1,6 +1,4 @@ import pytest -from datetime import timedelta -from datetime import datetime from ereuse_devicehub.client import UserClient from ereuse_devicehub.resources.action import models as ma @@ -47,13 +45,8 @@ def test_simple_metrics(user: UserClient): user.post(acer, res=ma.Snapshot) # Check metrics - today = datetime.now() - delta = timedelta(days=30) - data = {"start_time": today-delta, - "end_time": today+delta - } metrics = {'allocateds': 1, 'live': 1} - res, _ = user.get("/metrics/", query_string=data) + res, _ = user.get("/metrics/") assert res == metrics @@ -92,13 +85,8 @@ def test_second_hdd_metrics(user: UserClient): hdd['serialNumber'] = 'WD-WX11A80W7440' user.post(acer, res=ma.Snapshot) - # Check metrics - today = datetime.now() - delta = timedelta(days=30) - data = {"start_time": today-delta, - "end_time": today+delta - } - metrics = {'allocateds': 1, 'live': 2} - res, _ = user.get("/metrics/", query_string=data) + # Check metrics if we change the hdd we need a result of one device + metrics = {'allocateds': 1, 'live': 1} + res, _ = user.get("/metrics/") assert res == metrics