From 6766d75a225b938c57ae1d32a6aeb3d77bba5062 Mon Sep 17 00:00:00 2001 From: Aliaksandr Nikitsin Date: Mon, 15 Jun 2026 15:50:00 +0200 Subject: [PATCH] report device deep copy --- framework/python/src/common/testreport.py | 32 +++++++++++++---------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/framework/python/src/common/testreport.py b/framework/python/src/common/testreport.py index a213fd7c4..c37aa375d 100644 --- a/framework/python/src/common/testreport.py +++ b/framework/python/src/common/testreport.py @@ -13,21 +13,22 @@ # limitations under the License. """Store previous Testrun information.""" -from datetime import datetime -import shutil -from weasyprint import HTML -from io import BytesIO -from common import util, logger -from common.statuses import TestrunStatus, TestrunResult -from test_orc import test_pack import base64 +import copy +import math import os -from test_orc.test_case import TestCase -from jinja2 import Environment, FileSystemLoader, BaseLoader +import shutil from collections import OrderedDict -from bs4 import BeautifulSoup -import math +from datetime import datetime +from io import BytesIO +from bs4 import BeautifulSoup +from common import logger, util +from common.statuses import TestrunResult, TestrunStatus +from jinja2 import BaseLoader, Environment, FileSystemLoader +from test_orc import test_pack +from test_orc.test_case import TestCase +from weasyprint import HTML DATE_TIME_FORMAT = '%Y-%m-%d %H:%M:%S' RESOURCES_DIR = 'resources/report' @@ -159,7 +160,7 @@ def to_json(self): } report_json['mac_addr'] = self._mac_addr - report_json['device'] = self._device + report_json['device'] = copy.deepcopy(self._device) report_json['status'] = self._status report_json['result'] = self._result report_json['started'] = self._started.strftime(DATE_TIME_FORMAT) @@ -270,8 +271,11 @@ def from_json(self, json_file): self.add_test(test_case) def to_json_updated(self, device): - self.update_device_info(device) - return self.to_json() + json_data = self.to_json() + json_data['device']['manufacturer'] = device.manufacturer + json_data['device']['model'] = device.model + json_data['device']['device_profile'] = device.additional_info + return json_data # Create a pdf file in memory and return the bytes def to_pdf(self):