test: append KPI rather than overwrite in set_kpi() method

this allows to call set_kpi() multiple times in one TC

Change-Id: I5f68d9e6e1135ee2afa79c9af2ed240d371214c4
This commit is contained in:
Andre Puschmann 2020-06-22 22:49:24 +02:00
parent 0694c30c8e
commit 8b27ded781
1 changed files with 4 additions and 1 deletions

View File

@ -143,7 +143,10 @@ class Test(log.Origin):
def set_kpis(self, kpis):
if not isinstance(kpis, dict):
raise log.Error('Expected dictionary in toplevel kpis')
self._kpis = kpis
if isinstance(self._kpis, dict):
self._kpis.update(kpis)
else:
self._kpis = kpis
def kpis(self):
return self._kpis