Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 18 additions & 14 deletions framework/python/src/common/testreport.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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):
Expand Down
Loading