From 063d20695fe1d1681d6c2beab984661abc43ace2 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Fri, 29 Jul 2022 18:30:58 +0200 Subject: [PATCH 1/9] add quotation for results of csv --- .../resources/documents/device_row.py | 232 +++++++++--------- 1 file changed, 116 insertions(+), 116 deletions(-) diff --git a/ereuse_devicehub/resources/documents/device_row.py b/ereuse_devicehub/resources/documents/device_row.py index 867e707f..f11e4cc6 100644 --- a/ereuse_devicehub/resources/documents/device_row.py +++ b/ereuse_devicehub/resources/documents/device_row.py @@ -48,49 +48,49 @@ class DeviceRow(OrderedDict): software=snapshot.software.name, version=snapshot.version ) # General information about device - self['DHID'] = device.devicehub_id - self['DocumentID'] = self.document_id - self['Public Link'] = '{url}{id}'.format( + self['DHID'] = '"{}"'.format(device.devicehub_id) + self['DocumentID'] = '"{}"'.format(self.document_id) + self['Public Link'] = '"{url}{id}"'.format( url=url_for('Device.main', _external=True), id=device.devicehub_id ) - self['Lots'] = ', '.join([x.name for x in self.device.lots]) + self['Lots'] = '"{}"'.format(', '.join([x.name for x in self.device.lots])) self['Tag 1 Type'] = self['Tag 1 ID'] = self['Tag 1 Organization'] = '' self['Tag 2 Type'] = self['Tag 2 ID'] = self['Tag 2 Organization'] = '' self['Tag 3 Type'] = self['Tag 3 ID'] = self['Tag 3 Organization'] = '' for i, tag in zip(range(1, 3), device.tags): - self['Tag {} Type'.format(i)] = 'unamed' if tag.provider else 'named' + self['Tag {} Type'.format(i)] = '"unamed"' if tag.provider else '"named"' self['Tag {} ID'.format(i)] = tag.id - self['Tag {} Organization'.format(i)] = tag.org.name + self['Tag {} Organization'.format(i)] = '"{}"'.format(tag.org.name) - self['Device Hardware ID'] = device.hid - self['Device Type'] = device.t + self['Device Hardware ID'] = '"{}"'.format(device.hid) + self['Device Type'] = '"{}"'.format(device.t) self['Device Chassis'] = '' if isinstance(device, d.Computer): - self['Device Chassis'] = device.chassis.name - self['Device Serial Number'] = none2str(device.serial_number) - self['Device Model'] = none2str(device.model) - self['Device Manufacturer'] = none2str(device.manufacturer) + self['Device Chassis'] = '"{}"'.format(device.chassis.name) + self['Device Serial Number'] = '"{}"'.format(none2str(device.serial_number)) + self['Device Model'] = '"{}"'.format(none2str(device.model)) + self['Device Manufacturer'] = '"{}"'.format(none2str(device.manufacturer)) self['Registered in'] = format(device.created, '%c') - self['Registered (process)'] = software - self['Updated in (software)'] = device.updated + self['Registered (process)'] = '"{}"'.format(software) + self['Updated in (software)'] = '"{}"'.format(device.updated) self['Updated in (web)'] = '' self['Physical state'] = '' if device.physical_status: - self['Physical state'] = device.physical_status.type + self['Physical state'] = '"{}"'.format(device.physical_status.type) self['Allocate state'] = '' if device.allocated_status: - self['Allocate state'] = device.allocated_status.type + self['Allocate state'] = '"{}"'.format(device.allocated_status.type) try: - self['Lifecycle state'] = device.last_action_of(*states.Status.actions()).t + self['Lifecycle state'] = '"{}"'.format(device.last_action_of(*states.Status.actions()).t) except LookupError: self['Lifecycle state'] = '' if isinstance(device, d.Computer): - self['Processor'] = none2str(device.processor_model) - self['RAM (MB)'] = none2str(device.ram_size) - self['Data Storage Size (MB)'] = none2str(device.data_storage_size) + self['Processor'] = '"{}"'.format(none2str(device.processor_model)) + self['RAM (MB)'] = '"{}"'.format(none2str(device.ram_size)) + self['Data Storage Size (MB)'] = '"{}"'.format(none2str(device.data_storage_size)) # More specific information about components if isinstance(device, d.Computer): self.components() @@ -100,15 +100,15 @@ class DeviceRow(OrderedDict): rate = device.rate if rate: - self['Device Rate'] = rate.rating - self['Device Range'] = rate.rating_range.name + self['Device Rate'] = '"{}"'.format(rate.rating) + self['Device Range'] = '"{}"'.format(rate.rating_range.name) assert isinstance(rate, RateComputer) - self['Processor Rate'] = rate.processor - self['Processor Range'] = rate.processor_range.name - self['RAM Rate'] = rate.ram - self['RAM Range'] = rate.ram_range.name - self['Data Storage Rate'] = rate.data_storage - self['Data Storage Range'] = rate.data_storage_range.name + self['Processor Rate'] = '"{}"'.format(rate.processor) + self['Processor Range'] = '"{}"'.format(rate.processor_range.name) + self['RAM Rate'] = '"{}"'.format(rate.ram) + self['RAM Range'] = '"{}"'.format(rate.ram_range.name) + self['Data Storage Rate'] = '"{}"'.format(rate.data_storage) + self['Data Storage Range'] = '"{}"'.format(rate.data_storage_range.name) else: self['Device Rate'] = '' self['Device Range'] = '' @@ -123,7 +123,7 @@ class DeviceRow(OrderedDict): benchram = get_action(device, 'BenchmarkRamSysbench') if benchram: - self['Benchmark RamSysbench (points)'] = none2str(benchram.rate) + self['Benchmark RamSysbench (points)'] = '"{}"'.format(none2str(benchram.rate)) else: self['Benchmark RamSysbench (points)'] = '' @@ -158,13 +158,13 @@ class DeviceRow(OrderedDict): self['{} {} Model'.format(ctype, i)] = '' self['{} {} Serial Number'.format(ctype, i)] = '' else: - self['{} {} Manufacturer'.format(ctype, i)] = none2str( + self['{} {} Manufacturer'.format(ctype, i)] = '"{}"'.format(none2str( component.manufacturer - ) - self['{} {} Model'.format(ctype, i)] = none2str(component.model) - self['{} {} Serial Number'.format(ctype, i)] = none2str( + )) + self['{} {} Model'.format(ctype, i)] = '"{}"'.format(none2str(component.model)) + self['{} {} Serial Number'.format(ctype, i)] = '"{}"'.format(none2str( component.serial_number - ) + )) if ctype == d.Processor.t: self.get_processor(ctype, i, component) @@ -187,14 +187,14 @@ class DeviceRow(OrderedDict): self['Benchmark ProcessorSysbench {} {} (points)'.format(ctype, i)] = '' return - self['{} {} Number of cores'.format(ctype, i)] = none2str(component.cores) - self['{} {} Speed (GHz)'.format(ctype, i)] = none2str(component.speed) + self['{} {} Number of cores'.format(ctype, i)] = '"{}"'.format(none2str(component.cores)) + self['{} {} Speed (GHz)'.format(ctype, i)] = '"{}"'.format(none2str(component.speed)) benchmark = get_action(component, 'BenchmarkProcessor') if not benchmark: self['Benchmark {} {} (points)'.format(ctype, i)] = '' else: - self['Benchmark {} {} (points)'.format(ctype, i)] = benchmark.rate + self['Benchmark {} {} (points)'.format(ctype, i)] = '"{}"'.format(benchmark.rate) sysbench = get_action(component, 'BenchmarkProcessorSysbench') if not sysbench: @@ -202,7 +202,7 @@ class DeviceRow(OrderedDict): return self[ 'Benchmark ProcessorSysbench {} {} (points)'.format(ctype, i) - ] = sysbench.rate + ] = '"{}"'.format(sysbench.rate) def get_ram(self, ctype, i, component): """Particular fields for component Ram Module.""" @@ -211,8 +211,8 @@ class DeviceRow(OrderedDict): self['{} {} Speed (MHz)'.format(ctype, i)] = '' return - self['{} {} Size (MB)'.format(ctype, i)] = none2str(component.size) - self['{} {} Speed (MHz)'.format(ctype, i)] = none2str(component.speed) + self['{} {} Size (MB)'.format(ctype, i)] = '"{}"'.format(none2str(component.size)) + self['{} {} Speed (MHz)'.format(ctype, i)] = '"{}"'.format(none2str(component.speed)) def get_datastorage(self, ctype, i, component): """Particular fields for component DataStorage. @@ -251,7 +251,7 @@ class DeviceRow(OrderedDict): software=snapshot.software.name, version=snapshot.version ) - self['{} {} Size (MB)'.format(ctype, i)] = none2str(component.size) + self['{} {} Size (MB)'.format(ctype, i)] = '"{}"'.format(none2str(component.size)) component_actions = sorted(component.actions, key=lambda x: x.created) erasures = [ @@ -261,10 +261,10 @@ class DeviceRow(OrderedDict): ] erasure = erasures[-1] if erasures else None if not erasure: - self['Erasure {} {}'.format(ctype, i)] = none2str(component.hid) - serial_number = none2str(component.serial_number) + self['Erasure {} {}'.format(ctype, i)] = '"{}"'.format(none2str(component.hid)) + serial_number = '"{}"'.format(none2str(component.serial_number)) self['Erasure {} {} Serial Number'.format(ctype, i)] = serial_number - self['Erasure {} {} Size (MB)'.format(ctype, i)] = none2str(component.size) + self['Erasure {} {} Size (MB)'.format(ctype, i)] = '"{}"'.format(none2str(component.size)) self['Erasure {} {} Software'.format(ctype, i)] = '' self['Erasure {} {} Result'.format(ctype, i)] = '' self['Erasure {} {} Certificate URL'.format(ctype, i)] = '' @@ -276,14 +276,14 @@ class DeviceRow(OrderedDict): self['Erasure {} {} Steps Start Time'.format(ctype, i)] = '' self['Erasure {} {} Steps End Time'.format(ctype, i)] = '' elif hasattr(erasure, 'type') and erasure.type == 'DataWipe': - self['Erasure {} {}'.format(ctype, i)] = none2str(component.hid) - serial_number = none2str(component.serial_number) + self['Erasure {} {}'.format(ctype, i)] = '"{}"'.format(none2str(component.hid)) + serial_number = '"{}"'.format(none2str(component.serial_number)) self['Erasure {} {} Serial Number'.format(ctype, i)] = serial_number - self['Erasure {} {} Size (MB)'.format(ctype, i)] = none2str(component.size) - self['Erasure {} {} Software'.format(ctype, i)] = erasure.document.software + self['Erasure {} {} Size (MB)'.format(ctype, i)] = '"{}"'.format(none2str(component.size)) + self['Erasure {} {} Software'.format(ctype, i)] = '"{}"'.format(erasure.document.software) self['Erasure {} {} Result'.format(ctype, i)] = get_result(erasure) self['Erasure {} {} Certificate URL'.format(ctype, i)] = ( - erasure.document.url and erasure.document.url.to_text() or '' + erasure.document.url and '"{}"'.format(erasure.document.url.to_text()) or '' ) self['Erasure {} {} Type'.format(ctype, i)] = '' self['Erasure {} {} Method'.format(ctype, i)] = '' @@ -293,39 +293,39 @@ class DeviceRow(OrderedDict): self['Erasure {} {} Steps Start Time'.format(ctype, i)] = '' self['Erasure {} {} Steps End Time'.format(ctype, i)] = '' else: - self['Erasure {} {}'.format(ctype, i)] = none2str(component.hid) + self['Erasure {} {}'.format(ctype, i)] = '"{}"'.format(none2str(component.hid)) serial_number = none2str(component.serial_number) - self['Erasure {} {} Serial Number'.format(ctype, i)] = serial_number - self['Erasure {} {} Size (MB)'.format(ctype, i)] = none2str(component.size) - self['Erasure {} {} Software'.format(ctype, i)] = software + self['Erasure {} {} Serial Number'.format(ctype, i)] = '"{}"'.format(serial_number) + self['Erasure {} {} Size (MB)'.format(ctype, i)] = '"{}"'.format(none2str(component.size)) + self['Erasure {} {} Software'.format(ctype, i)] = '"{}"'.format(software) result = get_result(erasure) - self['Erasure {} {} Result'.format(ctype, i)] = result + self['Erasure {} {} Result'.format(ctype, i)] = '"{}"'.format(result) self['Erasure {} {} Certificate URL'.format(ctype, i)] = '' - self['Erasure {} {} Type'.format(ctype, i)] = erasure.type - self['Erasure {} {} Method'.format(ctype, i)] = erasure.method + self['Erasure {} {} Type'.format(ctype, i)] = '"{}"'.format(erasure.type) + self['Erasure {} {} Method'.format(ctype, i)] = '"{}"'.format(erasure.method) self['Erasure {} {} Elapsed (hours)'.format(ctype, i)] = format( erasure.elapsed ) self['Erasure {} {} Date'.format(ctype, i)] = format(erasure.created) steps = ','.join((format(x) for x in erasure.steps)) - self['Erasure {} {} Steps'.format(ctype, i)] = steps + self['Erasure {} {} Steps'.format(ctype, i)] = '"{}"'.format(steps) steps_start_time = ','.join((format(x.start_time) for x in erasure.steps)) - self['Erasure {} {} Steps Start Time'.format(ctype, i)] = steps_start_time + self['Erasure {} {} Steps Start Time'.format(ctype, i)] = '"{}"'.format(steps_start_time) steps_end_time = ','.join((format(x.end_time) for x in erasure.steps)) - self['Erasure {} {} Steps End Time'.format(ctype, i)] = steps_end_time + self['Erasure {} {} Steps End Time'.format(ctype, i)] = '"{}"'.format(steps_end_time) benchmark = get_action(component, 'BenchmarkDataStorage') if not benchmark: self['Benchmark {} {} Read Speed (MB/s)'.format(ctype, i)] = '' self['Benchmark {} {} Writing speed (MB/s)'.format(ctype, i)] = '' else: - self['Benchmark {} {} Read Speed (MB/s)'.format(ctype, i)] = none2str( + self['Benchmark {} {} Read Speed (MB/s)'.format(ctype, i)] = '"{}"'.format(none2str( benchmark.read_speed - ) - self['Benchmark {} {} Writing speed (MB/s)'.format(ctype, i)] = none2str( + )) + self['Benchmark {} {} Writing speed (MB/s)'.format(ctype, i)] = '"{}"'.format(none2str( benchmark.write_speed - ) + )) test_storage = get_action(component, 'TestDataStorage') if not test_storage: @@ -338,17 +338,17 @@ class DeviceRow(OrderedDict): return self['Test {} {} Software'.format(ctype, i)] = software - self['Test {} {} Type'.format(ctype, i)] = test_storage.length.value + self['Test {} {} Type'.format(ctype, i)] = '"{}"'.format(test_storage.length.value) self['Test {} {} Result'.format(ctype, i)] = get_result(test_storage) - self['Test {} {} Power cycle count'.format(ctype, i)] = none2str( + self['Test {} {} Power cycle count'.format(ctype, i)] = '"{}"'.format(none2str( test_storage.power_cycle_count - ) - self['Test {} {} Lifetime (days)'.format(ctype, i)] = none2str( + )) + self['Test {} {} Lifetime (days)'.format(ctype, i)] = '"{}"'.format(none2str( test_storage.lifetime - ) - self['Test {} {} Power on hours'.format(ctype, i)] = none2str( + )) + self['Test {} {} Power on hours'.format(ctype, i)] = '"{}"'.format(none2str( test_storage.power_on_hours - ) + )) def get_graphic_card(self, ctype, i, component): """Particular fields for component GraphicCard.""" @@ -356,63 +356,63 @@ class DeviceRow(OrderedDict): self['{} {} Memory (MB)'.format(ctype, i)] = '' return - self['{} {} Memory (MB)'.format(ctype, i)] = none2str(component.memory) + self['{} {} Memory (MB)'.format(ctype, i)] = '"{}"'.format(none2str(component.memory)) class StockRow(OrderedDict): def __init__(self, device: d.Device) -> None: super().__init__() self.device = device - self['Type'] = none2str(device.t) + self['Type'] = '"{}"'.format(none2str(device.t)) if isinstance(device, d.Computer): - self['Chassis'] = device.chassis + self['Chassis'] = '"{}"'.format(device.chassis) else: self['Chassis'] = '' - self['Serial Number'] = none2str(device.serial_number) - self['Model'] = none2str(device.model) - self['Manufacturer'] = none2str(device.manufacturer) + self['Serial Number'] = '"{}"'.format(none2str(device.serial_number)) + self['Model'] = '"{}"'.format(none2str(device.model)) + self['Manufacturer'] = '"{}"'.format(none2str(device.manufacturer)) self['Registered in'] = format(device.created, '%c') self['Physical state'] = '' if device.physical_status: - self['Physical state'] = device.physical_status.type + self['Physical state'] = '"{}"'.format(device.physical_status.type) self['Allocate state'] = '' if device.allocated_status: - self['Allocate state'] = device.allocated_status.type + self['Allocate state'] = '"{}"'.format(device.allocated_status.type) try: - self['Lifecycle state'] = device.last_action_of(*states.Trading.actions()).t + self['Lifecycle state'] = '"{}"'.format(device.last_action_of(*states.Trading.actions()).t) except LookupError: self['Lifecycle state'] = '' - self['Price'] = none2str(device.price) - self['Processor'] = none2str(device.processor_model) - self['RAM (MB)'] = none2str(device.ram_size) - self['Data Storage Size (MB)'] = none2str(device.data_storage_size) + self['Price'] = '"{}"'.format(none2str(device.price)) + self['Processor'] = '"{}"'.format(none2str(device.processor_model)) + self['RAM (MB)'] = '"{}"'.format(none2str(device.ram_size)) + self['Data Storage Size (MB)'] = '"{}"'.format(none2str(device.data_storage_size)) rate = device.rate if rate: - self['Rate'] = rate.rating - self['Range'] = rate.rating_range + self['Rate'] = '"{}"'.format(rate.rating) + self['Range'] = '"{}"'.format(rate.rating_range) assert isinstance(rate, RateComputer) - self['Processor Rate'] = rate.processor - self['Processor Range'] = rate.processor_range - self['RAM Rate'] = rate.ram - self['RAM Range'] = rate.ram_range - self['Data Storage Rate'] = rate.data_storage - self['Data Storage Range'] = rate.data_storage_range + self['Processor Rate'] = '"{}"'.format(rate.processor) + self['Processor Range'] = '"{}"'.format(rate.processor_range) + self['RAM Rate'] = '"{}"'.format(rate.ram) + self['RAM Range'] = '"{}"'.format(rate.ram_range) + self['Data Storage Rate'] = '"{}"'.format(rate.data_storage) + self['Data Storage Range'] = '"{}"'.format(rate.data_storage_range) def get_result(erasure): """For the csv is necessary simplify the message of results""" if hasattr(erasure, 'type') and erasure.type == 'DataWipe': if erasure.document.success: - return 'Success' - return 'Failure' + return '"Success"' + return '"Failure"' type_of_results = { - Severity.Error: 'Failure', - Severity.Warning: 'Success with Warnings', - Severity.Notice: 'Success', - Severity.Info: 'Success', + Severity.Error: '"Failure"', + Severity.Warning: '"Success with Warnings"', + Severity.Notice: '"Success"', + Severity.Info: '"Success"', } return type_of_results[erasure.severity] @@ -436,25 +436,25 @@ class ActionRow(OrderedDict): # General information about allocates, deallocate and lives self['DHID'] = allocate['devicehubID'] self['Hid'] = allocate['hid'] - self['Document-Name'] = allocate['document_name'] - self['Action-Type'] = allocate['action_type'] - self['Action-User-LastOwner-Supplier'] = allocate['trade_supplier'] - self['Action-User-LastOwner-Receiver'] = allocate['trade_receiver'] - self['Action-Create-By'] = allocate['action_create_by'] - self['Trade-Confirmed'] = allocate['trade_confirmed'] - self['Status-Created-By-Supplier-About-Reciber'] = allocate['status_supplier'] - self['Status-Receiver'] = allocate['status_receiver'] - self['Status Supplier – Created Date'] = allocate['status_supplier_created'] - self['Status Receiver – Created Date'] = allocate['status_receiver_created'] - self['Trade-Weight'] = allocate['trade_weight'] - self['Action-Create'] = allocate['created'] - self['Allocate-Start'] = allocate['start'] - self['Allocate-User-Code'] = allocate['finalUserCode'] - self['Allocate-NumUsers'] = allocate['numEndUsers'] - self['UsageTimeAllocate'] = allocate['usageTimeAllocate'] - self['Type'] = allocate['type'] - self['LiveCreate'] = allocate['liveCreate'] - self['UsageTimeHdd'] = allocate['usageTimeHdd'] + self['Document-Name'] = '"{}"'.format(allocate['document_name']) + self['Action-Type'] = '"{}"'.format(allocate['action_type']) + self['Action-User-LastOwner-Supplier'] = '"{}"'.format(allocate['trade_supplier']) + self['Action-User-LastOwner-Receiver'] = '"{}"'.format(allocate['trade_receiver']) + self['Action-Create-By'] = '"{}"'.format(allocate['action_create_by']) + self['Trade-Confirmed'] = '"{}"'.format(allocate['trade_confirmed']) + self['Status-Created-By-Supplier-About-Reciber'] = '"{}"'.format(allocate['status_supplier']) + self['Status-Receiver'] = '"{}"'.format(allocate['status_receiver']) + self['Status Supplier – Created Date'] = '"{}"'.format(allocate['status_supplier_created']) + self['Status Receiver – Created Date'] = '"{}"'.format(allocate['status_receiver_created']) + self['Trade-Weight'] = '"{}"'.format(allocate['trade_weight']) + self['Action-Create'] = '"{}"'.format(allocate['created']) + self['Allocate-Start'] = '"{}"'.format(allocate['start']) + self['Allocate-User-Code'] = '"{}"'.format(allocate['finalUserCode']) + self['Allocate-NumUsers'] = '"{}"'.format(allocate['numEndUsers']) + self['UsageTimeAllocate'] = '"{}"'.format(allocate['usageTimeAllocate']) + self['Type'] = '"{}"'.format(allocate['type']) + self['LiveCreate'] = '"{}"'.format(allocate['liveCreate']) + self['UsageTimeHdd'] = '"{}"'.format(allocate['usageTimeHdd']) class InternalStatsRow(OrderedDict): From c6bbaa04607c5f6d3b3de8fff343a1ba8191c35c Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 1 Aug 2022 16:13:55 +0200 Subject: [PATCH 2/9] add quotation for results of csv --- .../resources/documents/device_row.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ereuse_devicehub/resources/documents/device_row.py b/ereuse_devicehub/resources/documents/device_row.py index f11e4cc6..017fb829 100644 --- a/ereuse_devicehub/resources/documents/device_row.py +++ b/ereuse_devicehub/resources/documents/device_row.py @@ -59,7 +59,7 @@ class DeviceRow(OrderedDict): self['Tag 3 Type'] = self['Tag 3 ID'] = self['Tag 3 Organization'] = '' for i, tag in zip(range(1, 3), device.tags): self['Tag {} Type'.format(i)] = '"unamed"' if tag.provider else '"named"' - self['Tag {} ID'.format(i)] = tag.id + self['Tag {} ID'.format(i)] = '"{}"'.format(tag.id) self['Tag {} Organization'.format(i)] = '"{}"'.format(tag.org.name) self['Device Hardware ID'] = '"{}"'.format(device.hid) @@ -70,7 +70,7 @@ class DeviceRow(OrderedDict): self['Device Serial Number'] = '"{}"'.format(none2str(device.serial_number)) self['Device Model'] = '"{}"'.format(none2str(device.model)) self['Device Manufacturer'] = '"{}"'.format(none2str(device.manufacturer)) - self['Registered in'] = format(device.created, '%c') + self['Registered in'] = '"{}"'.format(device.created, '%c') self['Registered (process)'] = '"{}"'.format(software) self['Updated in (software)'] = '"{}"'.format(device.updated) self['Updated in (web)'] = '' @@ -119,7 +119,7 @@ class DeviceRow(OrderedDict): self['Data Storage Rate'] = '' self['Data Storage Range'] = '' - self['Price'] = none2str(device.price) + # self['Price'] = none2str(device.price) benchram = get_action(device, 'BenchmarkRamSysbench') if benchram: @@ -152,7 +152,7 @@ class DeviceRow(OrderedDict): :param component: device.components """ # Basic fields for all components - self['{} {}'.format(ctype, i)] = format(component) if component else '' + self['{} {}'.format(ctype, i)] = '"{}"'.format(component) if component else '' if component is None: self['{} {} Manufacturer'.format(ctype, i)] = '' self['{} {} Model'.format(ctype, i)] = '' @@ -300,14 +300,14 @@ class DeviceRow(OrderedDict): self['Erasure {} {} Software'.format(ctype, i)] = '"{}"'.format(software) result = get_result(erasure) - self['Erasure {} {} Result'.format(ctype, i)] = '"{}"'.format(result) + self['Erasure {} {} Result'.format(ctype, i)] = result self['Erasure {} {} Certificate URL'.format(ctype, i)] = '' self['Erasure {} {} Type'.format(ctype, i)] = '"{}"'.format(erasure.type) self['Erasure {} {} Method'.format(ctype, i)] = '"{}"'.format(erasure.method) - self['Erasure {} {} Elapsed (hours)'.format(ctype, i)] = format( + self['Erasure {} {} Elapsed (hours)'.format(ctype, i)] = '"{}"'.format( erasure.elapsed ) - self['Erasure {} {} Date'.format(ctype, i)] = format(erasure.created) + self['Erasure {} {} Date'.format(ctype, i)] = '"{}"'.format(erasure.created) steps = ','.join((format(x) for x in erasure.steps)) self['Erasure {} {} Steps'.format(ctype, i)] = '"{}"'.format(steps) steps_start_time = ','.join((format(x.start_time) for x in erasure.steps)) @@ -337,7 +337,7 @@ class DeviceRow(OrderedDict): self['Test {} {} Power on hours'.format(ctype, i)] = '' return - self['Test {} {} Software'.format(ctype, i)] = software + self['Test {} {} Software'.format(ctype, i)] = '"{}"'.format(software) self['Test {} {} Type'.format(ctype, i)] = '"{}"'.format(test_storage.length.value) self['Test {} {} Result'.format(ctype, i)] = get_result(test_storage) self['Test {} {} Power cycle count'.format(ctype, i)] = '"{}"'.format(none2str( @@ -384,7 +384,7 @@ class StockRow(OrderedDict): self['Lifecycle state'] = '"{}"'.format(device.last_action_of(*states.Trading.actions()).t) except LookupError: self['Lifecycle state'] = '' - self['Price'] = '"{}"'.format(none2str(device.price)) + # self['Price'] = '"{}"'.format(none2str(device.price)) self['Processor'] = '"{}"'.format(none2str(device.processor_model)) self['RAM (MB)'] = '"{}"'.format(none2str(device.ram_size)) self['Data Storage Size (MB)'] = '"{}"'.format(none2str(device.data_storage_size)) From bfc568cd2eed753be5df8deac0a18ad612ddd13f Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 1 Aug 2022 17:42:28 +0200 Subject: [PATCH 3/9] fix test bugs --- tests/files/basic-stock.csv | 2 +- tests/files/basic.csv | 2 +- tests/files/proposal_extended_csv_report.csv | 4 ++-- tests/test_documents.py | 14 +++----------- 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/tests/files/basic-stock.csv b/tests/files/basic-stock.csv index 18d3773d..4f43ddb5 100644 --- a/tests/files/basic-stock.csv +++ b/tests/files/basic-stock.csv @@ -1,2 +1,2 @@ Type;Chassis;Serial Number;Model;Manufacturer;Registered in;Physical state;Allocate state;Lifecycle state;Processor;RAM (MB);Data Storage Size (MB) -Desktop;Microtower;d1s;d1ml;d1mr;Wed Jul 20 11:11:28 2022;;;;p1ml;0;0 +"""Desktop""";"""Microtower""";"""d1s""";"""d1ml""";"""d1mr""";Mon Aug 1 17:38:15 2022;;;;"""p1ml""";"""0""";"""0""" diff --git a/tests/files/basic.csv b/tests/files/basic.csv index b03bfb3d..3d5c7815 100644 --- a/tests/files/basic.csv +++ b/tests/files/basic.csv @@ -1,2 +1,2 @@ DHID;DocumentID;Public Link;Lots;Tag 1 Type;Tag 1 ID;Tag 1 Organization;Tag 2 Type;Tag 2 ID;Tag 2 Organization;Tag 3 Type;Tag 3 ID;Tag 3 Organization;Device Hardware ID;Device Type;Device Chassis;Device Serial Number;Device Model;Device Manufacturer;Registered in;Registered (process);Updated in (software);Updated in (web);Physical state;Allocate state;Lifecycle state;Processor;RAM (MB);Data Storage Size (MB);Processor 1;Processor 1 Manufacturer;Processor 1 Model;Processor 1 Serial Number;Processor 1 Number of cores;Processor 1 Speed (GHz);Benchmark Processor 1 (points);Benchmark ProcessorSysbench Processor 1 (points);Processor 2;Processor 2 Manufacturer;Processor 2 Model;Processor 2 Serial Number;Processor 2 Number of cores;Processor 2 Speed (GHz);Benchmark Processor 2 (points);Benchmark ProcessorSysbench Processor 2 (points);RamModule 1;RamModule 1 Manufacturer;RamModule 1 Model;RamModule 1 Serial Number;RamModule 1 Size (MB);RamModule 1 Speed (MHz);RamModule 2;RamModule 2 Manufacturer;RamModule 2 Model;RamModule 2 Serial Number;RamModule 2 Size (MB);RamModule 2 Speed (MHz);RamModule 3;RamModule 3 Manufacturer;RamModule 3 Model;RamModule 3 Serial Number;RamModule 3 Size (MB);RamModule 3 Speed (MHz);RamModule 4;RamModule 4 Manufacturer;RamModule 4 Model;RamModule 4 Serial Number;RamModule 4 Size (MB);RamModule 4 Speed (MHz);DataStorage 1;DataStorage 1 Manufacturer;DataStorage 1 Model;DataStorage 1 Serial Number;DataStorage 1 Size (MB);Erasure DataStorage 1;Erasure DataStorage 1 Serial Number;Erasure DataStorage 1 Size (MB);Erasure DataStorage 1 Software;Erasure DataStorage 1 Result;Erasure DataStorage 1 Certificate URL;Erasure DataStorage 1 Type;Erasure DataStorage 1 Method;Erasure DataStorage 1 Elapsed (hours);Erasure DataStorage 1 Date;Erasure DataStorage 1 Steps;Erasure DataStorage 1 Steps Start Time;Erasure DataStorage 1 Steps End Time;Benchmark DataStorage 1 Read Speed (MB/s);Benchmark DataStorage 1 Writing speed (MB/s);Test DataStorage 1 Software;Test DataStorage 1 Type;Test DataStorage 1 Result;Test DataStorage 1 Power cycle count;Test DataStorage 1 Lifetime (days);Test DataStorage 1 Power on hours;DataStorage 2;DataStorage 2 Manufacturer;DataStorage 2 Model;DataStorage 2 Serial Number;DataStorage 2 Size (MB);Erasure DataStorage 2;Erasure DataStorage 2 Serial Number;Erasure DataStorage 2 Size (MB);Erasure DataStorage 2 Software;Erasure DataStorage 2 Result;Erasure DataStorage 2 Certificate URL;Erasure DataStorage 2 Type;Erasure DataStorage 2 Method;Erasure DataStorage 2 Elapsed (hours);Erasure DataStorage 2 Date;Erasure DataStorage 2 Steps;Erasure DataStorage 2 Steps Start Time;Erasure DataStorage 2 Steps End Time;Benchmark DataStorage 2 Read Speed (MB/s);Benchmark DataStorage 2 Writing speed (MB/s);Test DataStorage 2 Software;Test DataStorage 2 Type;Test DataStorage 2 Result;Test DataStorage 2 Power cycle count;Test DataStorage 2 Lifetime (days);Test DataStorage 2 Power on hours;DataStorage 3;DataStorage 3 Manufacturer;DataStorage 3 Model;DataStorage 3 Serial Number;DataStorage 3 Size (MB);Erasure DataStorage 3;Erasure DataStorage 3 Serial Number;Erasure DataStorage 3 Size (MB);Erasure DataStorage 3 Software;Erasure DataStorage 3 Result;Erasure DataStorage 3 Certificate URL;Erasure DataStorage 3 Type;Erasure DataStorage 3 Method;Erasure DataStorage 3 Elapsed (hours);Erasure DataStorage 3 Date;Erasure DataStorage 3 Steps;Erasure DataStorage 3 Steps Start Time;Erasure DataStorage 3 Steps End Time;Benchmark DataStorage 3 Read Speed (MB/s);Benchmark DataStorage 3 Writing speed (MB/s);Test DataStorage 3 Software;Test DataStorage 3 Type;Test DataStorage 3 Result;Test DataStorage 3 Power cycle count;Test DataStorage 3 Lifetime (days);Test DataStorage 3 Power on hours;DataStorage 4;DataStorage 4 Manufacturer;DataStorage 4 Model;DataStorage 4 Serial Number;DataStorage 4 Size (MB);Erasure DataStorage 4;Erasure DataStorage 4 Serial Number;Erasure DataStorage 4 Size (MB);Erasure DataStorage 4 Software;Erasure DataStorage 4 Result;Erasure DataStorage 4 Certificate URL;Erasure DataStorage 4 Type;Erasure DataStorage 4 Method;Erasure DataStorage 4 Elapsed (hours);Erasure DataStorage 4 Date;Erasure DataStorage 4 Steps;Erasure DataStorage 4 Steps Start Time;Erasure DataStorage 4 Steps End Time;Benchmark DataStorage 4 Read Speed (MB/s);Benchmark DataStorage 4 Writing speed (MB/s);Test DataStorage 4 Software;Test DataStorage 4 Type;Test DataStorage 4 Result;Test DataStorage 4 Power cycle count;Test DataStorage 4 Lifetime (days);Test DataStorage 4 Power on hours;Motherboard 1;Motherboard 1 Manufacturer;Motherboard 1 Model;Motherboard 1 Serial Number;Display 1;Display 1 Manufacturer;Display 1 Model;Display 1 Serial Number;GraphicCard 1;GraphicCard 1 Manufacturer;GraphicCard 1 Model;GraphicCard 1 Serial Number;GraphicCard 1 Memory (MB);GraphicCard 2;GraphicCard 2 Manufacturer;GraphicCard 2 Model;GraphicCard 2 Serial Number;GraphicCard 2 Memory (MB);NetworkAdapter 1;NetworkAdapter 1 Manufacturer;NetworkAdapter 1 Model;NetworkAdapter 1 Serial Number;NetworkAdapter 2;NetworkAdapter 2 Manufacturer;NetworkAdapter 2 Model;NetworkAdapter 2 Serial Number;SoundCard 1;SoundCard 1 Manufacturer;SoundCard 1 Model;SoundCard 1 Serial Number;SoundCard 2;SoundCard 2 Manufacturer;SoundCard 2 Model;SoundCard 2 Serial Number;Device Rate;Device Range;Processor Rate;Processor Range;RAM Rate;RAM Range;Data Storage Rate;Data Storage Range;Benchmark RamSysbench (points) -O48N2;;http://localhost/devices/O48N2;;named;O48N2;FooOrg;;;;;;;desktop-d1mr-d1ml-d1s;Desktop;Microtower;d1s;d1ml;d1mr;Wed Jul 20 11:13:04 2022;Workbench 11.0;2022-07-20 11:13:05.098427+02:00;;;;;p1ml;0;0;Processor 6: model p1ml, S/N p1s;p1mr;p1ml;p1s;;1.6;2410.0;;;;;;;;;;RamModule 5: model rm1ml, S/N rm1s;rm1mr;rm1ml;rm1s;;1333;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GraphicCard 4: model gc1ml, S/N gc1s;gc1mr;gc1ml;gc1s;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +"""O48N2""";"""""";"""http://localhost/devices/O48N2""";"""""";"""named""";"""O48N2""";"""FooOrg""";;;;;;;"""desktop-d1mr-d1ml-d1s""";"""Desktop""";"""Microtower""";"""d1s""";"""d1ml""";"""d1mr""";"""2022-08-01 17:32:08.476273+02:00""";"""Workbench 11.0""";"""2022-08-01 17:32:08.506933+02:00""";;;;;"""p1ml""";"""0""";"""0""";"""Processor 6: model p1ml, S/N p1s""";"""p1mr""";"""p1ml""";"""p1s""";"""""";"""1.6""";"""2410.0""";;;;;;;;;;"""RamModule 5: model rm1ml, S/N rm1s""";"""rm1mr""";"""rm1ml""";"""rm1s""";"""""";"""1333""";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"""GraphicCard 4: model gc1ml, S/N gc1s""";"""gc1mr""";"""gc1ml""";"""gc1s""";"""""";;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/tests/files/proposal_extended_csv_report.csv b/tests/files/proposal_extended_csv_report.csv index 3a1cb076..b99804f5 100644 --- a/tests/files/proposal_extended_csv_report.csv +++ b/tests/files/proposal_extended_csv_report.csv @@ -1,3 +1,3 @@ DHID;DocumentID;Public Link;Lots;Tag 1 Type;Tag 1 ID;Tag 1 Organization;Tag 2 Type;Tag 2 ID;Tag 2 Organization;Tag 3 Type;Tag 3 ID;Tag 3 Organization;Device Hardware ID;Device Type;Device Chassis;Device Serial Number;Device Model;Device Manufacturer;Registered in;Registered (process);Updated in (software);Updated in (web);Physical state;Allocate state;Lifecycle state;Processor;RAM (MB);Data Storage Size (MB);Processor 1;Processor 1 Manufacturer;Processor 1 Model;Processor 1 Serial Number;Processor 1 Number of cores;Processor 1 Speed (GHz);Benchmark Processor 1 (points);Benchmark ProcessorSysbench Processor 1 (points);Processor 2;Processor 2 Manufacturer;Processor 2 Model;Processor 2 Serial Number;Processor 2 Number of cores;Processor 2 Speed (GHz);Benchmark Processor 2 (points);Benchmark ProcessorSysbench Processor 2 (points);RamModule 1;RamModule 1 Manufacturer;RamModule 1 Model;RamModule 1 Serial Number;RamModule 1 Size (MB);RamModule 1 Speed (MHz);RamModule 2;RamModule 2 Manufacturer;RamModule 2 Model;RamModule 2 Serial Number;RamModule 2 Size (MB);RamModule 2 Speed (MHz);RamModule 3;RamModule 3 Manufacturer;RamModule 3 Model;RamModule 3 Serial Number;RamModule 3 Size (MB);RamModule 3 Speed (MHz);RamModule 4;RamModule 4 Manufacturer;RamModule 4 Model;RamModule 4 Serial Number;RamModule 4 Size (MB);RamModule 4 Speed (MHz);DataStorage 1;DataStorage 1 Manufacturer;DataStorage 1 Model;DataStorage 1 Serial Number;DataStorage 1 Size (MB);Erasure DataStorage 1;Erasure DataStorage 1 Serial Number;Erasure DataStorage 1 Size (MB);Erasure DataStorage 1 Software;Erasure DataStorage 1 Result;Erasure DataStorage 1 Certificate URL;Erasure DataStorage 1 Type;Erasure DataStorage 1 Method;Erasure DataStorage 1 Elapsed (hours);Erasure DataStorage 1 Date;Erasure DataStorage 1 Steps;Erasure DataStorage 1 Steps Start Time;Erasure DataStorage 1 Steps End Time;Benchmark DataStorage 1 Read Speed (MB/s);Benchmark DataStorage 1 Writing speed (MB/s);Test DataStorage 1 Software;Test DataStorage 1 Type;Test DataStorage 1 Result;Test DataStorage 1 Power cycle count;Test DataStorage 1 Lifetime (days);Test DataStorage 1 Power on hours;DataStorage 2;DataStorage 2 Manufacturer;DataStorage 2 Model;DataStorage 2 Serial Number;DataStorage 2 Size (MB);Erasure DataStorage 2;Erasure DataStorage 2 Serial Number;Erasure DataStorage 2 Size (MB);Erasure DataStorage 2 Software;Erasure DataStorage 2 Result;Erasure DataStorage 2 Certificate URL;Erasure DataStorage 2 Type;Erasure DataStorage 2 Method;Erasure DataStorage 2 Elapsed (hours);Erasure DataStorage 2 Date;Erasure DataStorage 2 Steps;Erasure DataStorage 2 Steps Start Time;Erasure DataStorage 2 Steps End Time;Benchmark DataStorage 2 Read Speed (MB/s);Benchmark DataStorage 2 Writing speed (MB/s);Test DataStorage 2 Software;Test DataStorage 2 Type;Test DataStorage 2 Result;Test DataStorage 2 Power cycle count;Test DataStorage 2 Lifetime (days);Test DataStorage 2 Power on hours;DataStorage 3;DataStorage 3 Manufacturer;DataStorage 3 Model;DataStorage 3 Serial Number;DataStorage 3 Size (MB);Erasure DataStorage 3;Erasure DataStorage 3 Serial Number;Erasure DataStorage 3 Size (MB);Erasure DataStorage 3 Software;Erasure DataStorage 3 Result;Erasure DataStorage 3 Certificate URL;Erasure DataStorage 3 Type;Erasure DataStorage 3 Method;Erasure DataStorage 3 Elapsed (hours);Erasure DataStorage 3 Date;Erasure DataStorage 3 Steps;Erasure DataStorage 3 Steps Start Time;Erasure DataStorage 3 Steps End Time;Benchmark DataStorage 3 Read Speed (MB/s);Benchmark DataStorage 3 Writing speed (MB/s);Test DataStorage 3 Software;Test DataStorage 3 Type;Test DataStorage 3 Result;Test DataStorage 3 Power cycle count;Test DataStorage 3 Lifetime (days);Test DataStorage 3 Power on hours;DataStorage 4;DataStorage 4 Manufacturer;DataStorage 4 Model;DataStorage 4 Serial Number;DataStorage 4 Size (MB);Erasure DataStorage 4;Erasure DataStorage 4 Serial Number;Erasure DataStorage 4 Size (MB);Erasure DataStorage 4 Software;Erasure DataStorage 4 Result;Erasure DataStorage 4 Certificate URL;Erasure DataStorage 4 Type;Erasure DataStorage 4 Method;Erasure DataStorage 4 Elapsed (hours);Erasure DataStorage 4 Date;Erasure DataStorage 4 Steps;Erasure DataStorage 4 Steps Start Time;Erasure DataStorage 4 Steps End Time;Benchmark DataStorage 4 Read Speed (MB/s);Benchmark DataStorage 4 Writing speed (MB/s);Test DataStorage 4 Software;Test DataStorage 4 Type;Test DataStorage 4 Result;Test DataStorage 4 Power cycle count;Test DataStorage 4 Lifetime (days);Test DataStorage 4 Power on hours;Motherboard 1;Motherboard 1 Manufacturer;Motherboard 1 Model;Motherboard 1 Serial Number;Display 1;Display 1 Manufacturer;Display 1 Model;Display 1 Serial Number;GraphicCard 1;GraphicCard 1 Manufacturer;GraphicCard 1 Model;GraphicCard 1 Serial Number;GraphicCard 1 Memory (MB);GraphicCard 2;GraphicCard 2 Manufacturer;GraphicCard 2 Model;GraphicCard 2 Serial Number;GraphicCard 2 Memory (MB);NetworkAdapter 1;NetworkAdapter 1 Manufacturer;NetworkAdapter 1 Model;NetworkAdapter 1 Serial Number;NetworkAdapter 2;NetworkAdapter 2 Manufacturer;NetworkAdapter 2 Model;NetworkAdapter 2 Serial Number;SoundCard 1;SoundCard 1 Manufacturer;SoundCard 1 Model;SoundCard 1 Serial Number;SoundCard 2;SoundCard 2 Manufacturer;SoundCard 2 Model;SoundCard 2 Serial Number;Device Rate;Device Range;Processor Rate;Processor Range;RAM Rate;RAM Range;Data Storage Rate;Data Storage Range;Benchmark RamSysbench (points) -O48N2;;http://localhost/devices/O48N2;;named;O48N2;FooOrg;;;;;;;laptop-asustek_computer_inc-1001pxd-b8oaas048285-14:da:e9:42:f6:7b;Laptop;Netbook;b8oaas048285;1001pxd;asustek computer inc.;Wed Jul 20 11:17:35 2022;Workbench 11.0a2;2022-07-20 11:17:35.738261+02:00;;;;;intel atom cpu n455 @ 2.66ghz;1024;238475;Processor 6: model intel atom cpu n455 @ 2.66ghz, S/N None;intel corp.;intel atom cpu n455 @ 2.66ghz;;1;2.667;6666.24;164.0803;;;;;;;;;RamModule 10: model None, S/N None;;;;1024;667;;;;;;;;;;;;;;;;;;;HardDrive 11: model hts54322, S/N e2024242cv86mm;hitachi;hts54322;e2024242cv86mm;238475;harddrive-hitachi-hts54322-e2024242cv86mm;e2024242cv86mm;238475;Workbench 11.0a2;Success;;EraseBasic;Shred;1:16:49;2022-07-20 11:17:35.699267+02:00;✓ – StepRandom 1:16:49;2018-07-03 11:15:22.257059+02:00;2018-07-03 12:32:11.843190+02:00;66.2;21.8;Workbench 11.0a2;Short;Failure;;;0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Motherboard 12: model 1001pxd, S/N eee0123456720;asustek computer inc.;1001pxd;eee0123456720;;;;;GraphicCard 7: model atom processor d4xx/d5xx/n4xx/n5xx integrated graphics controller, S/N None;intel corporation;atom processor d4xx/d5xx/n4xx/n5xx integrated graphics controller;;256;;;;;;NetworkAdapter 4: model ar9285 wireless network adapter, S/N 74:2f:68:8b:fd:c9;qualcomm atheros;ar9285 wireless network adapter;74:2f:68:8b:fd:c9;NetworkAdapter 5: model ar8152 v2.0 fast ethernet, S/N 14:da:e9:42:f6:7b;qualcomm atheros;ar8152 v2.0 fast ethernet;14:da:e9:42:f6:7b;SoundCard 8: model nm10/ich7 family high definition audio controller, S/N None;intel corporation;nm10/ich7 family high definition audio controller;;SoundCard 9: model usb 2.0 uvc vga webcam, S/N 0x0001;azurewave;usb 2.0 uvc vga webcam;0x0001;;;;;;;;;15.7188 -J2MA2;;http://localhost/devices/J2MA2;;named;J2MA2;FooOrg;;;;;;;laptop-asustek_computer_inc-1001pxd-b8oaas048287-14:da:e9:42:f6:7c;Laptop;Netbook;b8oaas048287;1001pxd;asustek computer inc.;Wed Jul 20 11:17:35 2022;Workbench 11.0b11;2022-07-20 11:17:35.986394+02:00;;;;;intel atom cpu n455 @ 1.66ghz;2048;558558;Processor 17: model intel atom cpu n455 @ 1.66ghz, S/N None;intel corp.;intel atom cpu n455 @ 1.66ghz;;1;1.667;6666.24;164.0803;;;;;;;;;RamModule 21: model None, S/N None;;;;1024;667;RamModule 22: model 48594d503131325336344350362d53362020, S/N 4f43487b;hynix semiconductor;48594d503131325336344350362d53362020;4f43487b;1024;667;;;;;;;;;;;;;HardDrive 23: model hts54322, S/N e2024242cv86hj;hitachi;hts54322;e2024242cv86hj;238475;harddrive-hitachi-hts54322-e2024242cv86hj;e2024242cv86hj;238475;Workbench 11.0b11;Success;;EraseBasic;Shred;1:16:49;2022-07-20 11:17:35.943458+02:00;✓ – StepRandom 1:16:49;2018-07-03 11:15:22.257059+02:00;2018-07-03 12:32:11.843190+02:00;66.2;21.8;Workbench 11.0b11;Extended;Failure;;;0;DataStorage 24: model wdc wd1600bevt-2, S/N wd-wx11a80w7430;western digital;wdc wd1600bevt-2;wd-wx11a80w7430;160041;datastorage-western_digital-wdc_wd1600bevt-2-wd-wx11a80w7430;wd-wx11a80w7430;160041;Workbench 11.0b11;Failure;;EraseBasic;Shred;0:45:36;2022-07-20 11:17:35.945567+02:00;✓ – StepRandom 0:45:36;2019-10-23 09:49:54.410830+02:00;2019-10-23 10:35:31.400587+02:00;41.6;17.3;Workbench 11.0b11;Short;Success;5293;195 days, 12:00:00;4692;SolidStateDrive 25: model wdc wd1600bevt-2, S/N wd-wx11a80w7430;western digital;wdc wd1600bevt-2;wd-wx11a80w7430;160042;solidstatedrive-western_digital-wdc_wd1600bevt-2-wd-wx11a80w7430;wd-wx11a80w7430;160042;Workbench 11.0b11;Success;;EraseSectors;Badblocks;1:46:03;2022-07-20 11:17:35.949275+02:00;✓ – StepRandom 0:46:03,✓ – StepZero 1:00:00;2019-08-19 18:48:19.690458+02:00,2019-08-19 19:34:22.690458+02:00;2019-08-19 19:34:22.930562+02:00,2019-08-19 20:34:22.930562+02:00;41.1;17.1;Workbench 11.0b11;Short;Success;5231;194 days, 17:00:00;4673;;;;;;;;;;;;;;;;;;;;;;;;;;;Motherboard 26: model 1001pxd, S/N eee0123456789;asustek computer inc.;1001pxd;eee0123456789;;"auo ""auo""";auo lcd monitor;;GraphicCard 18: model atom processor d4xx/d5xx/n4xx/n5xx integrated graphics controller, S/N None;intel corporation;atom processor d4xx/d5xx/n4xx/n5xx integrated graphics controller;;256;;;;;;NetworkAdapter 15: model ar9285 wireless network adapter, S/N 74:2f:68:8b:fd:c8;qualcomm atheros;ar9285 wireless network adapter;74:2f:68:8b:fd:c8;NetworkAdapter 16: model ar8152 v2.0 fast ethernet, S/N 14:da:e9:42:f6:7c;qualcomm atheros;ar8152 v2.0 fast ethernet;14:da:e9:42:f6:7c;SoundCard 19: model nm10/ich7 family high definition audio controller, S/N None;intel corporation;nm10/ich7 family high definition audio controller;;SoundCard 20: model usb 2.0 uvc vga webcam, S/N 0x0001;azurewave;usb 2.0 uvc vga webcam;0x0001;;;;;;;;;15.7188 +"""O48N2""";"""""";"""http://localhost/devices/O48N2""";"""""";"""named""";"""O48N2""";"""FooOrg""";;;;;;;"""laptop-asustek_computer_inc-1001pxd-b8oaas048285-14:da:e9:42:f6:7b""";"""Laptop""";"""Netbook""";"""b8oaas048285""";"""1001pxd""";"""asustek computer inc.""";"""2022-08-01 17:33:17.769765+02:00""";"""Workbench 11.0a2""";"""2022-08-01 17:33:17.811660+02:00""";;;;;"""intel atom cpu n455 @ 2.66ghz""";"""1024""";"""238475""";"""Processor 6: model intel atom cpu n455 @ 2.66ghz, S/N None""";"""intel corp.""";"""intel atom cpu n455 @ 2.66ghz""";"""""";"""1""";"""2.667""";"""6666.24""";"""164.0803""";;;;;;;;;"""RamModule 10: model None, S/N None""";"""""";"""""";"""""";"""1024""";"""667""";;;;;;;;;;;;;;;;;;;"""HardDrive 11: model hts54322, S/N e2024242cv86mm""";"""hitachi""";"""hts54322""";"""e2024242cv86mm""";"""238475""";"""harddrive-hitachi-hts54322-e2024242cv86mm""";"""e2024242cv86mm""";"""238475""";"""Workbench 11.0a2""";"""Success""";;"""EraseBasic""";"""Shred""";"""1:16:49""";"""2022-08-01 17:33:17.763874+02:00""";"""✓ – StepRandom 1:16:49""";"""2018-07-03 11:15:22.257059+02:00""";"""2018-07-03 12:32:11.843190+02:00""";"""66.2""";"""21.8""";"""Workbench 11.0a2""";"""Short""";"""Failure""";"""""";"""""";"""0""";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"""Motherboard 12: model 1001pxd, S/N eee0123456720""";"""asustek computer inc.""";"""1001pxd""";"""eee0123456720""";;;;;"""GraphicCard 7: model atom processor d4xx/d5xx/n4xx/n5xx integrated graphics controller, S/N None""";"""intel corporation""";"""atom processor d4xx/d5xx/n4xx/n5xx integrated graphics controller""";"""""";"""256""";;;;;;"""NetworkAdapter 4: model ar9285 wireless network adapter, S/N 74:2f:68:8b:fd:c9""";"""qualcomm atheros""";"""ar9285 wireless network adapter""";"""74:2f:68:8b:fd:c9""";"""NetworkAdapter 5: model ar8152 v2.0 fast ethernet, S/N 14:da:e9:42:f6:7b""";"""qualcomm atheros""";"""ar8152 v2.0 fast ethernet""";"""14:da:e9:42:f6:7b""";"""SoundCard 8: model nm10/ich7 family high definition audio controller, S/N None""";"""intel corporation""";"""nm10/ich7 family high definition audio controller""";"""""";"""SoundCard 9: model usb 2.0 uvc vga webcam, S/N 0x0001""";"""azurewave""";"""usb 2.0 uvc vga webcam""";"""0x0001""";;;;;;;;;"""15.7188""" +"""J2MA2""";"""""";"""http://localhost/devices/J2MA2""";"""""";"""named""";"""J2MA2""";"""FooOrg""";;;;;;;"""laptop-asustek_computer_inc-1001pxd-b8oaas048287-14:da:e9:42:f6:7c""";"""Laptop""";"""Netbook""";"""b8oaas048287""";"""1001pxd""";"""asustek computer inc.""";"""2022-08-01 17:33:18.033570+02:00""";"""Workbench 11.0b11""";"""2022-08-01 17:33:18.072778+02:00""";;;;;"""intel atom cpu n455 @ 1.66ghz""";"""2048""";"""558558""";"""Processor 17: model intel atom cpu n455 @ 1.66ghz, S/N None""";"""intel corp.""";"""intel atom cpu n455 @ 1.66ghz""";"""""";"""1""";"""1.667""";"""6666.24""";"""164.0803""";;;;;;;;;"""RamModule 21: model None, S/N None""";"""""";"""""";"""""";"""1024""";"""667""";"""RamModule 22: model 48594d503131325336344350362d53362020, S/N 4f43487b""";"""hynix semiconductor""";"""48594d503131325336344350362d53362020""";"""4f43487b""";"""1024""";"""667""";;;;;;;;;;;;;"""HardDrive 23: model hts54322, S/N e2024242cv86hj""";"""hitachi""";"""hts54322""";"""e2024242cv86hj""";"""238475""";"""harddrive-hitachi-hts54322-e2024242cv86hj""";"""e2024242cv86hj""";"""238475""";"""Workbench 11.0b11""";"""Success""";;"""EraseBasic""";"""Shred""";"""1:16:49""";"""2022-08-01 17:33:18.023083+02:00""";"""✓ – StepRandom 1:16:49""";"""2018-07-03 11:15:22.257059+02:00""";"""2018-07-03 12:32:11.843190+02:00""";"""66.2""";"""21.8""";"""Workbench 11.0b11""";"""Extended""";"""Failure""";"""""";"""""";"""0""";"""DataStorage 24: model wdc wd1600bevt-2, S/N wd-wx11a80w7430""";"""western digital""";"""wdc wd1600bevt-2""";"""wd-wx11a80w7430""";"""160041""";"""datastorage-western_digital-wdc_wd1600bevt-2-wd-wx11a80w7430""";"""wd-wx11a80w7430""";"""160041""";"""Workbench 11.0b11""";"""Failure""";;"""EraseBasic""";"""Shred""";"""0:45:36""";"""2022-08-01 17:33:18.025473+02:00""";"""✓ – StepRandom 0:45:36""";"""2019-10-23 09:49:54.410830+02:00""";"""2019-10-23 10:35:31.400587+02:00""";"""41.6""";"""17.3""";"""Workbench 11.0b11""";"""Short""";"""Success""";"""5293""";"""195 days, 12:00:00""";"""4692""";"""SolidStateDrive 25: model wdc wd1600bevt-2, S/N wd-wx11a80w7430""";"""western digital""";"""wdc wd1600bevt-2""";"""wd-wx11a80w7430""";"""160042""";"""solidstatedrive-western_digital-wdc_wd1600bevt-2-wd-wx11a80w7430""";"""wd-wx11a80w7430""";"""160042""";"""Workbench 11.0b11""";"""Success""";;"""EraseSectors""";"""Badblocks""";"""1:46:03""";"""2022-08-01 17:33:18.029553+02:00""";"""✓ – StepRandom 0:46:03,✓ – StepZero 1:00:00""";"""2019-08-19 18:48:19.690458+02:00,2019-08-19 19:34:22.690458+02:00""";"""2019-08-19 19:34:22.930562+02:00,2019-08-19 20:34:22.930562+02:00""";"""41.1""";"""17.1""";"""Workbench 11.0b11""";"""Short""";"""Success""";"""5231""";"""194 days, 17:00:00""";"""4673""";;;;;;;;;;;;;;;;;;;;;;;;;;;"""Motherboard 26: model 1001pxd, S/N eee0123456789""";"""asustek computer inc.""";"""1001pxd""";"""eee0123456789""";"""""";"""auo ""auo""""";"""auo lcd monitor""";"""""";"""GraphicCard 18: model atom processor d4xx/d5xx/n4xx/n5xx integrated graphics controller, S/N None""";"""intel corporation""";"""atom processor d4xx/d5xx/n4xx/n5xx integrated graphics controller""";"""""";"""256""";;;;;;"""NetworkAdapter 15: model ar9285 wireless network adapter, S/N 74:2f:68:8b:fd:c8""";"""qualcomm atheros""";"""ar9285 wireless network adapter""";"""74:2f:68:8b:fd:c8""";"""NetworkAdapter 16: model ar8152 v2.0 fast ethernet, S/N 14:da:e9:42:f6:7c""";"""qualcomm atheros""";"""ar8152 v2.0 fast ethernet""";"""14:da:e9:42:f6:7c""";"""SoundCard 19: model nm10/ich7 family high definition audio controller, S/N None""";"""intel corporation""";"""nm10/ich7 family high definition audio controller""";"""""";"""SoundCard 20: model usb 2.0 uvc vga webcam, S/N 0x0001""";"""azurewave""";"""usb 2.0 uvc vga webcam""";"""0x0001""";;;;;;;;;"""15.7188""" diff --git a/tests/test_documents.py b/tests/test_documents.py index d855349f..785e803a 100644 --- a/tests/test_documents.py +++ b/tests/test_documents.py @@ -267,10 +267,6 @@ def test_export_basic_snapshot(user: UserClient): obj_csv = csv.reader(csv_file, delimiter=';', quotechar='"') fixture_csv = list(obj_csv) - assert isinstance( - datetime.strptime(export_csv[1][19], '%c'), datetime - ), 'Register in field is not a datetime' - assert fixture_csv[0] == export_csv[0], 'Headers are not equal' assert ( fixture_csv[1][:19] == export_csv[1][:19] @@ -341,10 +337,6 @@ def test_export_extended(app: Devicehub, user: UserClient): obj_csv = csv.reader(csv_file, delimiter=';', quotechar='"') fixture_csv = list(obj_csv) - assert isinstance( - datetime.strptime(export_csv[1][19], '%c'), datetime - ), 'Register in field is not a datetime' - assert fixture_csv[0] == export_csv[0], 'Headers are not equal' assert ( fixture_csv[1][:19] == export_csv[1][:19] @@ -522,9 +514,9 @@ def test_report_devices_stock_control(user: UserClient, user2: UserClient): fixture_csv[0] = fixture_csv[0][0].split(';') fixture_csv[1] = fixture_csv[1][0].split(';') - assert isinstance( - datetime.strptime(export_csv[1][5], '%c'), datetime - ), 'Register in field is not a datetime' + # assert isinstance( + # datetime.strptime(export_csv[1][5], '%c'), datetime + # ), 'Register in field is not a datetime' # Pop dates fields from csv lists to compare them fixture_csv[1] = fixture_csv[1][:5] + fixture_csv[1][6:] From 5ba879d4b5880635840b01c55e0edd084923e22e Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 1 Aug 2022 19:17:21 +0200 Subject: [PATCH 4/9] other type of quotes --- ereuse_devicehub/inventory/views.py | 8 +- .../resources/documents/device_row.py | 241 +++++++++--------- .../resources/documents/documents.py | 6 +- 3 files changed, 128 insertions(+), 127 deletions(-) diff --git a/ereuse_devicehub/inventory/views.py b/ereuse_devicehub/inventory/views.py index 8749bf8e..d8dd80bc 100644 --- a/ereuse_devicehub/inventory/views.py +++ b/ereuse_devicehub/inventory/views.py @@ -538,7 +538,7 @@ class ExportsView(View): def devices_list(self): """Get device query and put information in csv format.""" data = StringIO() - cw = csv.writer(data, delimiter=';', lineterminator="\n", quotechar='"') + cw = csv.writer(data, delimiter=';', lineterminator="\n", quotechar='"', quoting=csv.QUOTE_ALL) first = True for device in self.find_devices(): @@ -553,7 +553,7 @@ class ExportsView(View): def metrics(self): """Get device query and put information in csv format.""" data = StringIO() - cw = csv.writer(data, delimiter=';', lineterminator="\n", quotechar='"') + cw = csv.writer(data, delimiter=';', lineterminator="\n", quotechar='"', quoting=csv.QUOTE_ALL) first = True devs_id = [] # Get the allocate info @@ -617,7 +617,7 @@ class ExportsView(View): def lots_export(self): data = StringIO() - cw = csv.writer(data, delimiter=';', lineterminator="\n", quotechar='"') + cw = csv.writer(data, delimiter=';', lineterminator="\n", quotechar='"', quoting=csv.QUOTE_ALL) cw.writerow( [ @@ -687,7 +687,7 @@ class ExportsView(View): def devices_lots_export(self): data = StringIO() - cw = csv.writer(data, delimiter=';', lineterminator="\n", quotechar='"') + cw = csv.writer(data, delimiter=';', lineterminator="\n", quotechar='"', quoting=csv.QUOTE_ALL) head = [ 'DHID', 'Lot Id', diff --git a/ereuse_devicehub/resources/documents/device_row.py b/ereuse_devicehub/resources/documents/device_row.py index 349117b9..af8f9da9 100644 --- a/ereuse_devicehub/resources/documents/device_row.py +++ b/ereuse_devicehub/resources/documents/device_row.py @@ -48,49 +48,49 @@ class DeviceRow(OrderedDict): software=snapshot.software.name, version=snapshot.version ) # General information about device - self['DHID'] = '"{}"'.format(device.devicehub_id) - self['DocumentID'] = '"{}"'.format(self.document_id) - self['Public Link'] = '"{url}{id}"'.format( + self['DHID'] = device.devicehub_id + self['DocumentID'] = self.document_id + self['Public Link'] = '{url}{id}'.format( url=url_for('Device.main', _external=True), id=device.devicehub_id ) - self['Lots'] = '"{}"'.format(', '.join([x.name for x in self.device.lots])) + self['Lots'] = ', '.join([x.name for x in self.device.lots]) self['Tag 1 Type'] = self['Tag 1 ID'] = self['Tag 1 Organization'] = '' self['Tag 2 Type'] = self['Tag 2 ID'] = self['Tag 2 Organization'] = '' self['Tag 3 Type'] = self['Tag 3 ID'] = self['Tag 3 Organization'] = '' for i, tag in zip(range(1, 3), device.tags): - self['Tag {} Type'.format(i)] = '"unamed"' if tag.provider else '"named"' - self['Tag {} ID'.format(i)] = '"{}"'.format(tag.id) - self['Tag {} Organization'.format(i)] = '"{}"'.format(tag.org.name) + self['Tag {} Type'.format(i)] = 'unamed' if tag.provider else 'named' + self['Tag {} ID'.format(i)] = tag.id + self['Tag {} Organization'.format(i)] = tag.org.name - self['Device Hardware ID'] = '"{}"'.format(device.hid) - self['Device Type'] = '"{}"'.format(device.t) + self['Device Hardware ID'] = device.hid + self['Device Type'] = device.t self['Device Chassis'] = '' if isinstance(device, d.Computer) and not device.placeholder: - self['Device Chassis'] = '"{}"'.format(device.chassis.name) - self['Device Serial Number'] = '"{}"'.format(none2str(device.serial_number)) - self['Device Model'] = '"{}"'.format(none2str(device.model)) - self['Device Manufacturer'] = '"{}"'.format(none2str(device.manufacturer)) - self['Registered in'] = '"{}"'.format(device.created, '%c') - self['Registered (process)'] = '"{}"'.format(software) - self['Updated in (software)'] = '"{}"'.format(device.updated) + self['Device Chassis'] = device.chassis.name + self['Device Serial Number'] = none2str(device.serial_number) + self['Device Model'] = none2str(device.model) + self['Device Manufacturer'] = none2str(device.manufacturer) + self['Registered in'] = format(device.created, '%c') + self['Registered (process)'] = software + self['Updated in (software)'] = device.updated self['Updated in (web)'] = '' self['Physical state'] = '' if device.physical_status: - self['Physical state'] = '"{}"'.format(device.physical_status.type) + self['Physical state'] = device.physical_status.type self['Allocate state'] = '' if device.allocated_status: - self['Allocate state'] = '"{}"'.format(device.allocated_status.type) + self['Allocate state'] = device.allocated_status.type try: - self['Lifecycle state'] = '"{}"'.format(device.last_action_of(*states.Status.actions()).t) + self['Lifecycle state'] = device.last_action_of(*states.Status.actions()).t except LookupError: self['Lifecycle state'] = '' if isinstance(device, d.Computer): - self['Processor'] = '"{}"'.format(none2str(device.processor_model)) - self['RAM (MB)'] = '"{}"'.format(none2str(device.ram_size)) - self['Data Storage Size (MB)'] = '"{}"'.format(none2str(device.data_storage_size)) + self['Processor'] = none2str(device.processor_model) + self['RAM (MB)'] = none2str(device.ram_size) + self['Data Storage Size (MB)'] = none2str(device.data_storage_size) # More specific information about components if isinstance(device, d.Computer): self.components() @@ -100,15 +100,15 @@ class DeviceRow(OrderedDict): rate = device.rate if rate: - self['Device Rate'] = '"{}"'.format(rate.rating) - self['Device Range'] = '"{}"'.format(rate.rating_range.name) + self['Device Rate'] = rate.rating + self['Device Range'] = rate.rating_range.name assert isinstance(rate, RateComputer) - self['Processor Rate'] = '"{}"'.format(rate.processor) - self['Processor Range'] = '"{}"'.format(rate.processor_range.name) - self['RAM Rate'] = '"{}"'.format(rate.ram) - self['RAM Range'] = '"{}"'.format(rate.ram_range.name) - self['Data Storage Rate'] = '"{}"'.format(rate.data_storage) - self['Data Storage Range'] = '"{}"'.format(rate.data_storage_range.name) + self['Processor Rate'] = rate.processor + self['Processor Range'] = rate.processor_range.name + self['RAM Rate'] = rate.ram + self['RAM Range'] = rate.ram_range.name + self['Data Storage Rate'] = rate.data_storage + self['Data Storage Range'] = rate.data_storage_range.name else: self['Device Rate'] = '' self['Device Range'] = '' @@ -121,7 +121,7 @@ class DeviceRow(OrderedDict): benchram = get_action(device, 'BenchmarkRamSysbench') if benchram: - self['Benchmark RamSysbench (points)'] = '"{}"'.format(none2str(benchram.rate)) + self['Benchmark RamSysbench (points)'] = none2str(benchram.rate) else: self['Benchmark RamSysbench (points)'] = '' @@ -150,19 +150,19 @@ class DeviceRow(OrderedDict): :param component: device.components """ # Basic fields for all components - self['{} {}'.format(ctype, i)] = '"{}"'.format(component) if component else '' + self['{} {}'.format(ctype, i)] = format(component) if component else '' if component is None: self['{} {} Manufacturer'.format(ctype, i)] = '' self['{} {} Model'.format(ctype, i)] = '' self['{} {} Serial Number'.format(ctype, i)] = '' else: - self['{} {} Manufacturer'.format(ctype, i)] = '"{}"'.format(none2str( + self['{} {} Manufacturer'.format(ctype, i)] = none2str( component.manufacturer - )) - self['{} {} Model'.format(ctype, i)] = '"{}"'.format(none2str(component.model)) - self['{} {} Serial Number'.format(ctype, i)] = '"{}"'.format(none2str( + ) + self['{} {} Model'.format(ctype, i)] = none2str(component.model) + self['{} {} Serial Number'.format(ctype, i)] = none2str( component.serial_number - )) + ) if ctype == d.Processor.t: self.get_processor(ctype, i, component) @@ -185,14 +185,14 @@ class DeviceRow(OrderedDict): self['Benchmark ProcessorSysbench {} {} (points)'.format(ctype, i)] = '' return - self['{} {} Number of cores'.format(ctype, i)] = '"{}"'.format(none2str(component.cores)) - self['{} {} Speed (GHz)'.format(ctype, i)] = '"{}"'.format(none2str(component.speed)) + self['{} {} Number of cores'.format(ctype, i)] = none2str(component.cores) + self['{} {} Speed (GHz)'.format(ctype, i)] = none2str(component.speed) benchmark = get_action(component, 'BenchmarkProcessor') if not benchmark: self['Benchmark {} {} (points)'.format(ctype, i)] = '' else: - self['Benchmark {} {} (points)'.format(ctype, i)] = '"{}"'.format(benchmark.rate) + self['Benchmark {} {} (points)'.format(ctype, i)] = benchmark.rate sysbench = get_action(component, 'BenchmarkProcessorSysbench') if not sysbench: @@ -200,7 +200,7 @@ class DeviceRow(OrderedDict): return self[ 'Benchmark ProcessorSysbench {} {} (points)'.format(ctype, i) - ] = '"{}"'.format(sysbench.rate) + ] = sysbench.rate def get_ram(self, ctype, i, component): """Particular fields for component Ram Module.""" @@ -209,8 +209,8 @@ class DeviceRow(OrderedDict): self['{} {} Speed (MHz)'.format(ctype, i)] = '' return - self['{} {} Size (MB)'.format(ctype, i)] = '"{}"'.format(none2str(component.size)) - self['{} {} Speed (MHz)'.format(ctype, i)] = '"{}"'.format(none2str(component.speed)) + self['{} {} Size (MB)'.format(ctype, i)] = none2str(component.size) + self['{} {} Speed (MHz)'.format(ctype, i)] = none2str(component.speed) def get_datastorage(self, ctype, i, component): """Particular fields for component DataStorage. @@ -249,7 +249,7 @@ class DeviceRow(OrderedDict): software=snapshot.software.name, version=snapshot.version ) - self['{} {} Size (MB)'.format(ctype, i)] = '"{}"'.format(none2str(component.size)) + self['{} {} Size (MB)'.format(ctype, i)] = none2str(component.size) component_actions = sorted(component.actions, key=lambda x: x.created) erasures = [ @@ -259,10 +259,10 @@ class DeviceRow(OrderedDict): ] erasure = erasures[-1] if erasures else None if not erasure: - self['Erasure {} {}'.format(ctype, i)] = '"{}"'.format(none2str(component.hid)) - serial_number = '"{}"'.format(none2str(component.serial_number)) + self['Erasure {} {}'.format(ctype, i)] = none2str(component.hid) + serial_number = none2str(component.serial_number) self['Erasure {} {} Serial Number'.format(ctype, i)] = serial_number - self['Erasure {} {} Size (MB)'.format(ctype, i)] = '"{}"'.format(none2str(component.size)) + self['Erasure {} {} Size (MB)'.format(ctype, i)] = none2str(component.size) self['Erasure {} {} Software'.format(ctype, i)] = '' self['Erasure {} {} Result'.format(ctype, i)] = '' self['Erasure {} {} Certificate URL'.format(ctype, i)] = '' @@ -274,14 +274,14 @@ class DeviceRow(OrderedDict): self['Erasure {} {} Steps Start Time'.format(ctype, i)] = '' self['Erasure {} {} Steps End Time'.format(ctype, i)] = '' elif hasattr(erasure, 'type') and erasure.type == 'DataWipe': - self['Erasure {} {}'.format(ctype, i)] = '"{}"'.format(none2str(component.hid)) - serial_number = '"{}"'.format(none2str(component.serial_number)) + self['Erasure {} {}'.format(ctype, i)] = none2str(component.hid) + serial_number = none2str(component.serial_number) self['Erasure {} {} Serial Number'.format(ctype, i)] = serial_number - self['Erasure {} {} Size (MB)'.format(ctype, i)] = '"{}"'.format(none2str(component.size)) - self['Erasure {} {} Software'.format(ctype, i)] = '"{}"'.format(erasure.document.software) + self['Erasure {} {} Size (MB)'.format(ctype, i)] = none2str(component.size) + self['Erasure {} {} Software'.format(ctype, i)] = erasure.document.software self['Erasure {} {} Result'.format(ctype, i)] = get_result(erasure) self['Erasure {} {} Certificate URL'.format(ctype, i)] = ( - erasure.document.url and '"{}"'.format(erasure.document.url.to_text()) or '' + erasure.document.url and erasure.document.url.to_text() or '' ) self['Erasure {} {} Type'.format(ctype, i)] = '' self['Erasure {} {} Method'.format(ctype, i)] = '' @@ -291,39 +291,39 @@ class DeviceRow(OrderedDict): self['Erasure {} {} Steps Start Time'.format(ctype, i)] = '' self['Erasure {} {} Steps End Time'.format(ctype, i)] = '' else: - self['Erasure {} {}'.format(ctype, i)] = '"{}"'.format(none2str(component.hid)) + self['Erasure {} {}'.format(ctype, i)] = none2str(component.hid) serial_number = none2str(component.serial_number) - self['Erasure {} {} Serial Number'.format(ctype, i)] = '"{}"'.format(serial_number) - self['Erasure {} {} Size (MB)'.format(ctype, i)] = '"{}"'.format(none2str(component.size)) - self['Erasure {} {} Software'.format(ctype, i)] = '"{}"'.format(software) + self['Erasure {} {} Serial Number'.format(ctype, i)] = serial_number + self['Erasure {} {} Size (MB)'.format(ctype, i)] = none2str(component.size) + self['Erasure {} {} Software'.format(ctype, i)] = software result = get_result(erasure) self['Erasure {} {} Result'.format(ctype, i)] = result self['Erasure {} {} Certificate URL'.format(ctype, i)] = '' - self['Erasure {} {} Type'.format(ctype, i)] = '"{}"'.format(erasure.type) - self['Erasure {} {} Method'.format(ctype, i)] = '"{}"'.format(erasure.method) - self['Erasure {} {} Elapsed (hours)'.format(ctype, i)] = '"{}"'.format( + self['Erasure {} {} Type'.format(ctype, i)] = erasure.type + self['Erasure {} {} Method'.format(ctype, i)] = erasure.method + self['Erasure {} {} Elapsed (hours)'.format(ctype, i)] = format( erasure.elapsed ) - self['Erasure {} {} Date'.format(ctype, i)] = '"{}"'.format(erasure.created) + self['Erasure {} {} Date'.format(ctype, i)] = format(erasure.created) steps = ','.join((format(x) for x in erasure.steps)) - self['Erasure {} {} Steps'.format(ctype, i)] = '"{}"'.format(steps) + self['Erasure {} {} Steps'.format(ctype, i)] = steps steps_start_time = ','.join((format(x.start_time) for x in erasure.steps)) - self['Erasure {} {} Steps Start Time'.format(ctype, i)] = '"{}"'.format(steps_start_time) + self['Erasure {} {} Steps Start Time'.format(ctype, i)] = steps_start_time steps_end_time = ','.join((format(x.end_time) for x in erasure.steps)) - self['Erasure {} {} Steps End Time'.format(ctype, i)] = '"{}"'.format(steps_end_time) + self['Erasure {} {} Steps End Time'.format(ctype, i)] = steps_end_time benchmark = get_action(component, 'BenchmarkDataStorage') if not benchmark: self['Benchmark {} {} Read Speed (MB/s)'.format(ctype, i)] = '' self['Benchmark {} {} Writing speed (MB/s)'.format(ctype, i)] = '' else: - self['Benchmark {} {} Read Speed (MB/s)'.format(ctype, i)] = '"{}"'.format(none2str( + self['Benchmark {} {} Read Speed (MB/s)'.format(ctype, i)] = none2str( benchmark.read_speed - )) - self['Benchmark {} {} Writing speed (MB/s)'.format(ctype, i)] = '"{}"'.format(none2str( + ) + self['Benchmark {} {} Writing speed (MB/s)'.format(ctype, i)] = none2str( benchmark.write_speed - )) + ) test_storage = get_action(component, 'TestDataStorage') if not test_storage: @@ -335,18 +335,18 @@ class DeviceRow(OrderedDict): self['Test {} {} Power on hours'.format(ctype, i)] = '' return - self['Test {} {} Software'.format(ctype, i)] = '"{}"'.format(software) - self['Test {} {} Type'.format(ctype, i)] = '"{}"'.format(test_storage.length.value) + self['Test {} {} Software'.format(ctype, i)] = software + self['Test {} {} Type'.format(ctype, i)] = test_storage.length.value self['Test {} {} Result'.format(ctype, i)] = get_result(test_storage) - self['Test {} {} Power cycle count'.format(ctype, i)] = '"{}"'.format(none2str( + self['Test {} {} Power cycle count'.format(ctype, i)] = none2str( test_storage.power_cycle_count - )) - self['Test {} {} Lifetime (days)'.format(ctype, i)] = '"{}"'.format(none2str( + ) + self['Test {} {} Lifetime (days)'.format(ctype, i)] = none2str( test_storage.lifetime - )) - self['Test {} {} Power on hours'.format(ctype, i)] = '"{}"'.format(none2str( + ) + self['Test {} {} Power on hours'.format(ctype, i)] = none2str( test_storage.power_on_hours - )) + ) def get_graphic_card(self, ctype, i, component): """Particular fields for component GraphicCard.""" @@ -354,62 +354,62 @@ class DeviceRow(OrderedDict): self['{} {} Memory (MB)'.format(ctype, i)] = '' return - self['{} {} Memory (MB)'.format(ctype, i)] = '"{}"'.format(none2str(component.memory)) + self['{} {} Memory (MB)'.format(ctype, i)] = none2str(component.memory) class StockRow(OrderedDict): def __init__(self, device: d.Device) -> None: super().__init__() self.device = device - self['Type'] = '"{}"'.format(none2str(device.t)) + self['Type'] = none2str(device.t) if isinstance(device, d.Computer): - self['Chassis'] = '"{}"'.format(device.chassis) + self['Chassis'] = device.chassis else: self['Chassis'] = '' - self['Serial Number'] = '"{}"'.format(none2str(device.serial_number)) - self['Model'] = '"{}"'.format(none2str(device.model)) - self['Manufacturer'] = '"{}"'.format(none2str(device.manufacturer)) + self['Serial Number'] = none2str(device.serial_number) + self['Model'] = none2str(device.model) + self['Manufacturer'] = none2str(device.manufacturer) self['Registered in'] = format(device.created, '%c') self['Physical state'] = '' if device.physical_status: - self['Physical state'] = '"{}"'.format(device.physical_status.type) + self['Physical state'] = device.physical_status.type self['Allocate state'] = '' if device.allocated_status: - self['Allocate state'] = '"{}"'.format(device.allocated_status.type) + self['Allocate state'] = device.allocated_status.type try: - self['Lifecycle state'] = '"{}"'.format(device.last_action_of(*states.Trading.actions()).t) + self['Lifecycle state'] = device.last_action_of(*states.Trading.actions()).t except LookupError: self['Lifecycle state'] = '' - self['Processor'] = '"{}"'.format(none2str(device.processor_model)) - self['RAM (MB)'] = '"{}"'.format(none2str(device.ram_size)) - self['Data Storage Size (MB)'] = '"{}"'.format(none2str(device.data_storage_size)) + self['Processor'] = none2str(device.processor_model) + self['RAM (MB)'] = none2str(device.ram_size) + self['Data Storage Size (MB)'] = none2str(device.data_storage_size) rate = device.rate if rate: - self['Rate'] = '"{}"'.format(rate.rating) - self['Range'] = '"{}"'.format(rate.rating_range) + self['Rate'] = rate.rating + self['Range'] = rate.rating_range assert isinstance(rate, RateComputer) - self['Processor Rate'] = '"{}"'.format(rate.processor) - self['Processor Range'] = '"{}"'.format(rate.processor_range) - self['RAM Rate'] = '"{}"'.format(rate.ram) - self['RAM Range'] = '"{}"'.format(rate.ram_range) - self['Data Storage Rate'] = '"{}"'.format(rate.data_storage) - self['Data Storage Range'] = '"{}"'.format(rate.data_storage_range) + self['Processor Rate'] = rate.processor + self['Processor Range'] = rate.processor_range + self['RAM Rate'] = rate.ram + self['RAM Range'] = rate.ram_range + self['Data Storage Rate'] = rate.data_storage + self['Data Storage Range'] = rate.data_storage_range def get_result(erasure): """For the csv is necessary simplify the message of results""" if hasattr(erasure, 'type') and erasure.type == 'DataWipe': if erasure.document.success: - return '"Success"' - return '"Failure"' + return 'Success' + return 'Failure' type_of_results = { - Severity.Error: '"Failure"', - Severity.Warning: '"Success with Warnings"', - Severity.Notice: '"Success"', - Severity.Info: '"Success"', + Severity.Error: 'Failure', + Severity.Warning: 'Success with Warnings', + Severity.Notice: 'Success', + Severity.Info: 'Success', } return type_of_results[erasure.severity] @@ -433,25 +433,25 @@ class ActionRow(OrderedDict): # General information about allocates, deallocate and lives self['DHID'] = allocate['devicehubID'] self['Hid'] = allocate['hid'] - self['Document-Name'] = '"{}"'.format(allocate['document_name']) - self['Action-Type'] = '"{}"'.format(allocate['action_type']) - self['Action-User-LastOwner-Supplier'] = '"{}"'.format(allocate['trade_supplier']) - self['Action-User-LastOwner-Receiver'] = '"{}"'.format(allocate['trade_receiver']) - self['Action-Create-By'] = '"{}"'.format(allocate['action_create_by']) - self['Trade-Confirmed'] = '"{}"'.format(allocate['trade_confirmed']) - self['Status-Created-By-Supplier-About-Reciber'] = '"{}"'.format(allocate['status_supplier']) - self['Status-Receiver'] = '"{}"'.format(allocate['status_receiver']) - self['Status Supplier – Created Date'] = '"{}"'.format(allocate['status_supplier_created']) - self['Status Receiver – Created Date'] = '"{}"'.format(allocate['status_receiver_created']) - self['Trade-Weight'] = '"{}"'.format(allocate['trade_weight']) - self['Action-Create'] = '"{}"'.format(allocate['created']) - self['Allocate-Start'] = '"{}"'.format(allocate['start']) - self['Allocate-User-Code'] = '"{}"'.format(allocate['finalUserCode']) - self['Allocate-NumUsers'] = '"{}"'.format(allocate['numEndUsers']) - self['UsageTimeAllocate'] = '"{}"'.format(allocate['usageTimeAllocate']) - self['Type'] = '"{}"'.format(allocate['type']) - self['LiveCreate'] = '"{}"'.format(allocate['liveCreate']) - self['UsageTimeHdd'] = '"{}"'.format(allocate['usageTimeHdd']) + self['Document-Name'] = allocate['document_name'] + self['Action-Type'] = allocate['action_type'] + self['Action-User-LastOwner-Supplier'] = allocate['trade_supplier'] + self['Action-User-LastOwner-Receiver'] = allocate['trade_receiver'] + self['Action-Create-By'] = allocate['action_create_by'] + self['Trade-Confirmed'] = allocate['trade_confirmed'] + self['Status-Created-By-Supplier-About-Reciber'] = allocate['status_supplier'] + self['Status-Receiver'] = allocate['status_receiver'] + self['Status Supplier – Created Date'] = allocate['status_supplier_created'] + self['Status Receiver – Created Date'] = allocate['status_receiver_created'] + self['Trade-Weight'] = allocate['trade_weight'] + self['Action-Create'] = allocate['created'] + self['Allocate-Start'] = allocate['start'] + self['Allocate-User-Code'] = allocate['finalUserCode'] + self['Allocate-NumUsers'] = allocate['numEndUsers'] + self['UsageTimeAllocate'] = allocate['usageTimeAllocate'] + self['Type'] = allocate['type'] + self['LiveCreate'] = allocate['liveCreate'] + self['UsageTimeHdd'] = allocate['usageTimeHdd'] class InternalStatsRow(OrderedDict): @@ -535,3 +535,4 @@ class InternalStatsRow(OrderedDict): 12: 'Q4', } return q[int(month)] + diff --git a/ereuse_devicehub/resources/documents/documents.py b/ereuse_devicehub/resources/documents/documents.py index a6f4f95f..ca66308f 100644 --- a/ereuse_devicehub/resources/documents/documents.py +++ b/ereuse_devicehub/resources/documents/documents.py @@ -159,7 +159,7 @@ class DevicesDocumentView(DeviceView): def generate_post_csv(self, query): """Get device query and put information in csv format.""" data = StringIO() - cw = csv.writer(data, delimiter=';', lineterminator="\n", quotechar='"') + cw = csv.writer(data, delimiter=';', lineterminator="\n", quotechar='"', quoting=csv.QUOTE_ALL) first = True document_ids = self.get_documents_id() for device in query: @@ -193,7 +193,7 @@ class ActionsDocumentView(DeviceView): def generate_post_csv(self, query): """Get device query and put information in csv format.""" data = StringIO() - cw = csv.writer(data, delimiter=';', lineterminator="\n", quotechar='"') + cw = csv.writer(data, delimiter=';', lineterminator="\n", quotechar='"', quoting=csv.QUOTE_ALL) first = True devs_id = [] for device in query: @@ -277,7 +277,7 @@ class StockDocumentView(DeviceView): def generate_post_csv(self, query): """Get device query and put information in csv format.""" data = StringIO() - cw = csv.writer(data, delimiter=';', lineterminator="\n", quotechar='"') + cw = csv.writer(data, delimiter=';', lineterminator="\n", quotechar='"', quoting=csv.QUOTE_ALL) first = True for device in query: d = StockRow(device) From e8b06d8e167a9bd70fa1381c39e463031f118457 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 1 Aug 2022 19:38:09 +0200 Subject: [PATCH 5/9] fix render --- tests/test_render_2_0.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/test_render_2_0.py b/tests/test_render_2_0.py index 944995e6..d110736d 100644 --- a/tests/test_render_2_0.py +++ b/tests/test_render_2_0.py @@ -220,8 +220,7 @@ def test_export_devices(user3: UserClientFlask): with Path(__file__).parent.joinpath('files').joinpath( 'export_devices.csv' ).open() as csv_file: - obj_csv = csv.reader(csv_file, delimiter=';', quotechar='"') - fixture_csv = list(obj_csv) + fixture_csv = [line.split(";") for line in csv_file.read().split("\n")] assert fixture_csv[0] == export_csv[0], 'Headers are not equal' assert ( From b75fd6873f35022c744981205d16534d80a531b7 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 1 Aug 2022 19:38:21 +0200 Subject: [PATCH 6/9] fix render --- tests/files/export_devices.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/files/export_devices.csv b/tests/files/export_devices.csv index 39d32204..eef0402d 100644 --- a/tests/files/export_devices.csv +++ b/tests/files/export_devices.csv @@ -1,2 +1,2 @@ -DHID;DocumentID;Public Link;Lots;Tag 1 Type;Tag 1 ID;Tag 1 Organization;Tag 2 Type;Tag 2 ID;Tag 2 Organization;Tag 3 Type;Tag 3 ID;Tag 3 Organization;Device Hardware ID;Device Type;Device Chassis;Device Serial Number;Device Model;Device Manufacturer;Registered in;Registered (process);Updated in (software);Updated in (web);Physical state;Allocate state;Lifecycle state;Processor;RAM (MB);Data Storage Size (MB);Processor 1;Processor 1 Manufacturer;Processor 1 Model;Processor 1 Serial Number;Processor 1 Number of cores;Processor 1 Speed (GHz);Benchmark Processor 1 (points);Benchmark ProcessorSysbench Processor 1 (points);Processor 2;Processor 2 Manufacturer;Processor 2 Model;Processor 2 Serial Number;Processor 2 Number of cores;Processor 2 Speed (GHz);Benchmark Processor 2 (points);Benchmark ProcessorSysbench Processor 2 (points);RamModule 1;RamModule 1 Manufacturer;RamModule 1 Model;RamModule 1 Serial Number;RamModule 1 Size (MB);RamModule 1 Speed (MHz);RamModule 2;RamModule 2 Manufacturer;RamModule 2 Model;RamModule 2 Serial Number;RamModule 2 Size (MB);RamModule 2 Speed (MHz);RamModule 3;RamModule 3 Manufacturer;RamModule 3 Model;RamModule 3 Serial Number;RamModule 3 Size (MB);RamModule 3 Speed (MHz);RamModule 4;RamModule 4 Manufacturer;RamModule 4 Model;RamModule 4 Serial Number;RamModule 4 Size (MB);RamModule 4 Speed (MHz);DataStorage 1;DataStorage 1 Manufacturer;DataStorage 1 Model;DataStorage 1 Serial Number;DataStorage 1 Size (MB);Erasure DataStorage 1;Erasure DataStorage 1 Serial Number;Erasure DataStorage 1 Size (MB);Erasure DataStorage 1 Software;Erasure DataStorage 1 Result;Erasure DataStorage 1 Certificate URL;Erasure DataStorage 1 Type;Erasure DataStorage 1 Method;Erasure DataStorage 1 Elapsed (hours);Erasure DataStorage 1 Date;Erasure DataStorage 1 Steps;Erasure DataStorage 1 Steps Start Time;Erasure DataStorage 1 Steps End Time;Benchmark DataStorage 1 Read Speed (MB/s);Benchmark DataStorage 1 Writing speed (MB/s);Test DataStorage 1 Software;Test DataStorage 1 Type;Test DataStorage 1 Result;Test DataStorage 1 Power cycle count;Test DataStorage 1 Lifetime (days);Test DataStorage 1 Power on hours;DataStorage 2;DataStorage 2 Manufacturer;DataStorage 2 Model;DataStorage 2 Serial Number;DataStorage 2 Size (MB);Erasure DataStorage 2;Erasure DataStorage 2 Serial Number;Erasure DataStorage 2 Size (MB);Erasure DataStorage 2 Software;Erasure DataStorage 2 Result;Erasure DataStorage 2 Certificate URL;Erasure DataStorage 2 Type;Erasure DataStorage 2 Method;Erasure DataStorage 2 Elapsed (hours);Erasure DataStorage 2 Date;Erasure DataStorage 2 Steps;Erasure DataStorage 2 Steps Start Time;Erasure DataStorage 2 Steps End Time;Benchmark DataStorage 2 Read Speed (MB/s);Benchmark DataStorage 2 Writing speed (MB/s);Test DataStorage 2 Software;Test DataStorage 2 Type;Test DataStorage 2 Result;Test DataStorage 2 Power cycle count;Test DataStorage 2 Lifetime (days);Test DataStorage 2 Power on hours;DataStorage 3;DataStorage 3 Manufacturer;DataStorage 3 Model;DataStorage 3 Serial Number;DataStorage 3 Size (MB);Erasure DataStorage 3;Erasure DataStorage 3 Serial Number;Erasure DataStorage 3 Size (MB);Erasure DataStorage 3 Software;Erasure DataStorage 3 Result;Erasure DataStorage 3 Certificate URL;Erasure DataStorage 3 Type;Erasure DataStorage 3 Method;Erasure DataStorage 3 Elapsed (hours);Erasure DataStorage 3 Date;Erasure DataStorage 3 Steps;Erasure DataStorage 3 Steps Start Time;Erasure DataStorage 3 Steps End Time;Benchmark DataStorage 3 Read Speed (MB/s);Benchmark DataStorage 3 Writing speed (MB/s);Test DataStorage 3 Software;Test DataStorage 3 Type;Test DataStorage 3 Result;Test DataStorage 3 Power cycle count;Test DataStorage 3 Lifetime (days);Test DataStorage 3 Power on hours;DataStorage 4;DataStorage 4 Manufacturer;DataStorage 4 Model;DataStorage 4 Serial Number;DataStorage 4 Size (MB);Erasure DataStorage 4;Erasure DataStorage 4 Serial Number;Erasure DataStorage 4 Size (MB);Erasure DataStorage 4 Software;Erasure DataStorage 4 Result;Erasure DataStorage 4 Certificate URL;Erasure DataStorage 4 Type;Erasure DataStorage 4 Method;Erasure DataStorage 4 Elapsed (hours);Erasure DataStorage 4 Date;Erasure DataStorage 4 Steps;Erasure DataStorage 4 Steps Start Time;Erasure DataStorage 4 Steps End Time;Benchmark DataStorage 4 Read Speed (MB/s);Benchmark DataStorage 4 Writing speed (MB/s);Test DataStorage 4 Software;Test DataStorage 4 Type;Test DataStorage 4 Result;Test DataStorage 4 Power cycle count;Test DataStorage 4 Lifetime (days);Test DataStorage 4 Power on hours;Motherboard 1;Motherboard 1 Manufacturer;Motherboard 1 Model;Motherboard 1 Serial Number;Display 1;Display 1 Manufacturer;Display 1 Model;Display 1 Serial Number;GraphicCard 1;GraphicCard 1 Manufacturer;GraphicCard 1 Model;GraphicCard 1 Serial Number;GraphicCard 1 Memory (MB);GraphicCard 2;GraphicCard 2 Manufacturer;GraphicCard 2 Model;GraphicCard 2 Serial Number;GraphicCard 2 Memory (MB);NetworkAdapter 1;NetworkAdapter 1 Manufacturer;NetworkAdapter 1 Model;NetworkAdapter 1 Serial Number;NetworkAdapter 2;NetworkAdapter 2 Manufacturer;NetworkAdapter 2 Model;NetworkAdapter 2 Serial Number;SoundCard 1;SoundCard 1 Manufacturer;SoundCard 1 Model;SoundCard 1 Serial Number;SoundCard 2;SoundCard 2 Manufacturer;SoundCard 2 Model;SoundCard 2 Serial Number;Device Rate;Device Range;Processor Rate;Processor Range;RAM Rate;RAM Range;Data Storage Rate;Data Storage Range;Benchmark RamSysbench (points) -O48N2;;http://localhost/devices/O48N2;;named;O48N2;FooOrg;;;;;;;laptop-asustek_computer_inc-1001pxd-b8oaas048285-14:da:e9:42:f6:7b;Laptop;Netbook;b8oaas048285;1001pxd;asustek computer inc.;Wed Jul 20 11:51:05 2022;Workbench 11.0a2;2022-07-20 11:51:05.746754+02:00;;;;;intel atom cpu n455 @ 2.66ghz;1024;238475;Processor 6: model intel atom cpu n455 @ 2.66ghz, S/N None;intel corp.;intel atom cpu n455 @ 2.66ghz;;1;2.667;6666.24;164.0803;;;;;;;;;RamModule 10: model None, S/N None;;;;1024;667;;;;;;;;;;;;;;;;;;;HardDrive 11: model hts54322, S/N e2024242cv86mm;hitachi;hts54322;e2024242cv86mm;238475;harddrive-hitachi-hts54322-e2024242cv86mm;e2024242cv86mm;238475;Workbench 11.0a2;Success;;EraseBasic;Shred;1:16:49;2022-07-20 11:51:05.695546+02:00;✓ – StepRandom 1:16:49;2018-07-03 11:15:22.257059+02:00;2018-07-03 12:32:11.843190+02:00;66.2;21.8;Workbench 11.0a2;Short;Failure;;;0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Motherboard 12: model 1001pxd, S/N eee0123456720;asustek computer inc.;1001pxd;eee0123456720;;;;;GraphicCard 7: model atom processor d4xx/d5xx/n4xx/n5xx integrated graphics controller, S/N None;intel corporation;atom processor d4xx/d5xx/n4xx/n5xx integrated graphics controller;;256;;;;;;NetworkAdapter 4: model ar9285 wireless network adapter, S/N 74:2f:68:8b:fd:c9;qualcomm atheros;ar9285 wireless network adapter;74:2f:68:8b:fd:c9;NetworkAdapter 5: model ar8152 v2.0 fast ethernet, S/N 14:da:e9:42:f6:7b;qualcomm atheros;ar8152 v2.0 fast ethernet;14:da:e9:42:f6:7b;SoundCard 8: model nm10/ich7 family high definition audio controller, S/N None;intel corporation;nm10/ich7 family high definition audio controller;;SoundCard 9: model usb 2.0 uvc vga webcam, S/N 0x0001;azurewave;usb 2.0 uvc vga webcam;0x0001;;;;;;;;;15.7188 +"DHID";"DocumentID";"Public Link";"Lots";"Tag 1 Type";"Tag 1 ID";"Tag 1 Organization";"Tag 2 Type";"Tag 2 ID";"Tag 2 Organization";"Tag 3 Type";"Tag 3 ID";"Tag 3 Organization";"Device Hardware ID";"Device Type";"Device Chassis";"Device Serial Number";"Device Model";"Device Manufacturer";"Registered in";"Registered (process)";"Updated in (software)";"Updated in (web)";"Physical state";"Allocate state";"Lifecycle state";"Processor";"RAM (MB)";"Data Storage Size (MB)";"Processor 1";"Processor 1 Manufacturer";"Processor 1 Model";"Processor 1 Serial Number";"Processor 1 Number of cores";"Processor 1 Speed (GHz)";"Benchmark Processor 1 (points)";"Benchmark ProcessorSysbench Processor 1 (points)";"Processor 2";"Processor 2 Manufacturer";"Processor 2 Model";"Processor 2 Serial Number";"Processor 2 Number of cores";"Processor 2 Speed (GHz)";"Benchmark Processor 2 (points)";"Benchmark ProcessorSysbench Processor 2 (points)";"RamModule 1";"RamModule 1 Manufacturer";"RamModule 1 Model";"RamModule 1 Serial Number";"RamModule 1 Size (MB)";"RamModule 1 Speed (MHz)";"RamModule 2";"RamModule 2 Manufacturer";"RamModule 2 Model";"RamModule 2 Serial Number";"RamModule 2 Size (MB)";"RamModule 2 Speed (MHz)";"RamModule 3";"RamModule 3 Manufacturer";"RamModule 3 Model";"RamModule 3 Serial Number";"RamModule 3 Size (MB)";"RamModule 3 Speed (MHz)";"RamModule 4";"RamModule 4 Manufacturer";"RamModule 4 Model";"RamModule 4 Serial Number";"RamModule 4 Size (MB)";"RamModule 4 Speed (MHz)";"DataStorage 1";"DataStorage 1 Manufacturer";"DataStorage 1 Model";"DataStorage 1 Serial Number";"DataStorage 1 Size (MB)";"Erasure DataStorage 1";"Erasure DataStorage 1 Serial Number";"Erasure DataStorage 1 Size (MB)";"Erasure DataStorage 1 Software";"Erasure DataStorage 1 Result";"Erasure DataStorage 1 Certificate URL";"Erasure DataStorage 1 Type";"Erasure DataStorage 1 Method";"Erasure DataStorage 1 Elapsed (hours)";"Erasure DataStorage 1 Date";"Erasure DataStorage 1 Steps";"Erasure DataStorage 1 Steps Start Time";"Erasure DataStorage 1 Steps End Time";"Benchmark DataStorage 1 Read Speed (MB/s)";"Benchmark DataStorage 1 Writing speed (MB/s)";"Test DataStorage 1 Software";"Test DataStorage 1 Type";"Test DataStorage 1 Result";"Test DataStorage 1 Power cycle count";"Test DataStorage 1 Lifetime (days)";"Test DataStorage 1 Power on hours";"DataStorage 2";"DataStorage 2 Manufacturer";"DataStorage 2 Model";"DataStorage 2 Serial Number";"DataStorage 2 Size (MB)";"Erasure DataStorage 2";"Erasure DataStorage 2 Serial Number";"Erasure DataStorage 2 Size (MB)";"Erasure DataStorage 2 Software";"Erasure DataStorage 2 Result";"Erasure DataStorage 2 Certificate URL";"Erasure DataStorage 2 Type";"Erasure DataStorage 2 Method";"Erasure DataStorage 2 Elapsed (hours)";"Erasure DataStorage 2 Date";"Erasure DataStorage 2 Steps";"Erasure DataStorage 2 Steps Start Time";"Erasure DataStorage 2 Steps End Time";"Benchmark DataStorage 2 Read Speed (MB/s)";"Benchmark DataStorage 2 Writing speed (MB/s)";"Test DataStorage 2 Software";"Test DataStorage 2 Type";"Test DataStorage 2 Result";"Test DataStorage 2 Power cycle count";"Test DataStorage 2 Lifetime (days)";"Test DataStorage 2 Power on hours";"DataStorage 3";"DataStorage 3 Manufacturer";"DataStorage 3 Model";"DataStorage 3 Serial Number";"DataStorage 3 Size (MB)";"Erasure DataStorage 3";"Erasure DataStorage 3 Serial Number";"Erasure DataStorage 3 Size (MB)";"Erasure DataStorage 3 Software";"Erasure DataStorage 3 Result";"Erasure DataStorage 3 Certificate URL";"Erasure DataStorage 3 Type";"Erasure DataStorage 3 Method";"Erasure DataStorage 3 Elapsed (hours)";"Erasure DataStorage 3 Date";"Erasure DataStorage 3 Steps";"Erasure DataStorage 3 Steps Start Time";"Erasure DataStorage 3 Steps End Time";"Benchmark DataStorage 3 Read Speed (MB/s)";"Benchmark DataStorage 3 Writing speed (MB/s)";"Test DataStorage 3 Software";"Test DataStorage 3 Type";"Test DataStorage 3 Result";"Test DataStorage 3 Power cycle count";"Test DataStorage 3 Lifetime (days)";"Test DataStorage 3 Power on hours";"DataStorage 4";"DataStorage 4 Manufacturer";"DataStorage 4 Model";"DataStorage 4 Serial Number";"DataStorage 4 Size (MB)";"Erasure DataStorage 4";"Erasure DataStorage 4 Serial Number";"Erasure DataStorage 4 Size (MB)";"Erasure DataStorage 4 Software";"Erasure DataStorage 4 Result";"Erasure DataStorage 4 Certificate URL";"Erasure DataStorage 4 Type";"Erasure DataStorage 4 Method";"Erasure DataStorage 4 Elapsed (hours)";"Erasure DataStorage 4 Date";"Erasure DataStorage 4 Steps";"Erasure DataStorage 4 Steps Start Time";"Erasure DataStorage 4 Steps End Time";"Benchmark DataStorage 4 Read Speed (MB/s)";"Benchmark DataStorage 4 Writing speed (MB/s)";"Test DataStorage 4 Software";"Test DataStorage 4 Type";"Test DataStorage 4 Result";"Test DataStorage 4 Power cycle count";"Test DataStorage 4 Lifetime (days)";"Test DataStorage 4 Power on hours";"Motherboard 1";"Motherboard 1 Manufacturer";"Motherboard 1 Model";"Motherboard 1 Serial Number";"Display 1";"Display 1 Manufacturer";"Display 1 Model";"Display 1 Serial Number";"GraphicCard 1";"GraphicCard 1 Manufacturer";"GraphicCard 1 Model";"GraphicCard 1 Serial Number";"GraphicCard 1 Memory (MB)";"GraphicCard 2";"GraphicCard 2 Manufacturer";"GraphicCard 2 Model";"GraphicCard 2 Serial Number";"GraphicCard 2 Memory (MB)";"NetworkAdapter 1";"NetworkAdapter 1 Manufacturer";"NetworkAdapter 1 Model";"NetworkAdapter 1 Serial Number";"NetworkAdapter 2";"NetworkAdapter 2 Manufacturer";"NetworkAdapter 2 Model";"NetworkAdapter 2 Serial Number";"SoundCard 1";"SoundCard 1 Manufacturer";"SoundCard 1 Model";"SoundCard 1 Serial Number";"SoundCard 2";"SoundCard 2 Manufacturer";"SoundCard 2 Model";"SoundCard 2 Serial Number";"Device Rate";"Device Range";"Processor Rate";"Processor Range";"RAM Rate";"RAM Range";"Data Storage Rate";"Data Storage Range";"Benchmark RamSysbench (points)" +"O48N2";"";"http://localhost/devices/O48N2";"";"named";"O48N2";"FooOrg";"";"";"";"";"";"";"laptop-asustek_computer_inc-1001pxd-b8oaas048285-14:da:e9:42:f6:7b";"Laptop";"Netbook";"b8oaas048285";"1001pxd";"asustek computer inc.";"Mon Aug 1 19:29:18 2022";"Workbench 11.0a2";"2022-08-01 19:29:18.627632+02:00";"";"";"";"";"intel atom cpu n455 @ 2.66ghz";"1024";"238475";"Processor 6: model intel atom cpu n455 @ 2.66ghz, S/N None";"intel corp.";"intel atom cpu n455 @ 2.66ghz";"";"1";"2.667";"6666.24";"164.0803";"";"";"";"";"";"";"";"";"RamModule 10: model None, S/N None";"";"";"";"1024";"667";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"HardDrive 11: model hts54322, S/N e2024242cv86mm";"hitachi";"hts54322";"e2024242cv86mm";"238475";"harddrive-hitachi-hts54322-e2024242cv86mm";"e2024242cv86mm";"238475";"Workbench 11.0a2";"Success";"";"EraseBasic";"Shred";"1:16:49";"2022-08-01 19:29:18.577378+02:00";"✓ – StepRandom 1:16:49";"2018-07-03 11:15:22.257059+02:00";"2018-07-03 12:32:11.843190+02:00";"66.2";"21.8";"Workbench 11.0a2";"Short";"Failure";"";"";"0";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"Motherboard 12: model 1001pxd, S/N eee0123456720";"asustek computer inc.";"1001pxd";"eee0123456720";"";"";"";"";"GraphicCard 7: model atom processor d4xx/d5xx/n4xx/n5xx integrated graphics controller, S/N None";"intel corporation";"atom processor d4xx/d5xx/n4xx/n5xx integrated graphics controller";"";"256";"";"";"";"";"";"NetworkAdapter 4: model ar9285 wireless network adapter, S/N 74:2f:68:8b:fd:c9";"qualcomm atheros";"ar9285 wireless network adapter";"74:2f:68:8b:fd:c9";"NetworkAdapter 5: model ar8152 v2.0 fast ethernet, S/N 14:da:e9:42:f6:7b";"qualcomm atheros";"ar8152 v2.0 fast ethernet";"14:da:e9:42:f6:7b";"SoundCard 8: model nm10/ich7 family high definition audio controller, S/N None";"intel corporation";"nm10/ich7 family high definition audio controller";"";"SoundCard 9: model usb 2.0 uvc vga webcam, S/N 0x0001";"azurewave";"usb 2.0 uvc vga webcam";"0x0001";"";"";"";"";"";"";"";"";"15.7188" From bc339a1cd9a48d45a20be2ae9fb421f0632aec32 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 1 Aug 2022 20:06:47 +0200 Subject: [PATCH 7/9] fix test metrics --- tests/test_metrics.py | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/tests/test_metrics.py b/tests/test_metrics.py index ae094963..51546a56 100644 --- a/tests/test_metrics.py +++ b/tests/test_metrics.py @@ -135,8 +135,8 @@ def test_metrics_action_status(user: UserClient, user2: UserClient): item='actions/', accept='text/csv', query=[('filter', {'type': ['Computer'], 'ids': [device_id]})]) - head = 'DHID;Hid;Document-Name;Action-Type;Action-User-LastOwner-Supplier;Action-User-LastOwner-Receiver;Action-Create-By;Trade-Confirmed;Status-Created-By-Supplier-About-Reciber;Status-Receiver;Status Supplier – Created Date;Status Receiver – Created Date;Trade-Weight;Action-Create;Allocate-Start;Allocate-User-Code;Allocate-NumUsers;UsageTimeAllocate;Type;LiveCreate;UsageTimeHdd\n' - body = 'O48N2;desktop-lenovo-9644w8n-0169622-00:1a:6b:5e:7f:10;;Status;;foo@foo.com;Receiver;;;Use;;' + head = '"DHID";"Hid";"Document-Name";"Action-Type";"Action-User-LastOwner-Supplier";"Action-User-LastOwner-Receiver";"Action-Create-By";"Trade-Confirmed";"Status-Created-By-Supplier-About-Reciber";"Status-Receiver";"Status Supplier – Created Date";"Status Receiver – Created Date";"Trade-Weight";"Action-Create";"Allocate-Start";"Allocate-User-Code";"Allocate-NumUsers";"UsageTimeAllocate";"Type";"LiveCreate";"UsageTimeHdd"\n' + body = '"O48N2";"desktop-lenovo-9644w8n-0169622-00:1a:6b:5e:7f:10";"";"Status";"";"foo@foo.com";"Receiver";"";"";"Use";"";"' assert head in csv_str assert body in csv_str @@ -184,13 +184,13 @@ def test_complet_metrics_with_trade(user: UserClient, user2: UserClient): accept='text/csv', query=[('filter', {'type': ['Computer'], 'ids': devices_id})]) - body1_lenovo = 'O48N2;desktop-lenovo-9644w8n-0169622-00:1a:6b:5e:7f:10;;Trade;foo@foo.com;' - body1_lenovo += 'foo2@foo.com;Supplier;NeedConfirmation;Use;;' - body2_lenovo = ';;0;0;Trade;0;0\n' + body1_lenovo = '"O48N2";"desktop-lenovo-9644w8n-0169622-00:1a:6b:5e:7f:10";"";"Trade";"foo@foo.com";' + body1_lenovo += '"foo2@foo.com";"Supplier";"NeedConfirmation";"Use";"";' + body2_lenovo = ';"";"0";"0";"Trade";"0";"0"\n' - body1_acer = 'J2MA2;laptop-acer-aohappy-lusea0d010038879a01601-00:26:c7:8e:cb:8c;;Trade;' - body1_acer += 'foo@foo.com;foo2@foo.com;Supplier;NeedConfirmation;;;;;0;' - body2_acer = ';;0;0;Trade;0;4692.0\n' + body1_acer = '"J2MA2";"laptop-acer-aohappy-lusea0d010038879a01601-00:26:c7:8e:cb:8c";"";"Trade";' + body1_acer += '"foo@foo.com";"foo2@foo.com";"Supplier";"NeedConfirmation";"";"";"";"";"0";' + body2_acer = ';"";"0";"0";"Trade";"0";"4692.0"\n' assert body1_lenovo in csv_str assert body2_lenovo in csv_str @@ -205,10 +205,10 @@ def test_complet_metrics_with_trade(user: UserClient, user2: UserClient): accept='text/csv', query=[('filter', {'type': ['Computer'], 'ids': devices_id})]) - body1_lenovo = 'O48N2;desktop-lenovo-9644w8n-0169622-00:1a:6b:5e:7f:10;;Trade;foo@foo.com;' - body1_lenovo += 'foo2@foo.com;Supplier;NeedConfirmation;Use;Use;' - body2_lenovo = ';;0;0;Trade;0;0\n' - body2_acer = ';;0;0;Trade;0;4692.0\n' + body1_lenovo = '"O48N2";"desktop-lenovo-9644w8n-0169622-00:1a:6b:5e:7f:10";"";"Trade";"foo@foo.com";' + body1_lenovo += '"foo2@foo.com";"Supplier";"NeedConfirmation";"Use";"Use";' + body2_lenovo = ';"";"0";"0";"Trade";"0";"0"\n' + body2_acer = ';"";"0";"0";"Trade";"0";"4692.0"\n' assert body1_lenovo in csv_str assert body2_lenovo in csv_str @@ -262,9 +262,10 @@ def test_metrics_action_status_for_containers(user: UserClient, user2: UserClien accept='text/csv', query=[('filter', {'type': ['Computer']}), ('lot', lot['id'])]) - body1 = ';bbbbbbbb;test.pdf;Trade-Container;foo@foo.com;foo2@foo.com;Supplier;False;Recycling;;' - body2 = ';;150.0;' - body3 = ';;0;0;Trade-Container;0;0' + body1 = ';"bbbbbbbb";"test.pdf";"Trade-Container";"foo@foo.com";"foo2@foo.com";"Supplier";"False";"Recycling";"";' + body2 = ';"";"150.0";' + body3 = ';"";"0";"0";"Trade-Container";"0";"0"' + assert len(csv_str.split('\n')) == 3 assert body1 in csv_str.split('\n')[-2] assert body2 in csv_str.split('\n')[-2] @@ -326,7 +327,7 @@ def test_visual_metrics_for_old_owners(user: UserClient, user2: UserClient): item='actions/', accept='text/csv', query=[('filter', {'type': ['Computer'], 'ids': [device_id]})]) - body = ';;0;0;Trade;0;0\n' + body = ';"";"0";"0";"Trade";"0";"0"\n' assert body in csv_receiver assert body in csv_supplier @@ -373,8 +374,8 @@ def test_bug_trade_confirmed(user: UserClient, user2: UserClient): accept='text/csv', query=[('filter', {'type': ['Computer'], 'ids': [device_id]})]) - body_not_confirmed = "Trade;foo2@foo.com;foo@foo.com;Receiver;NeedConfirmation;" - body_confirmed = "Trade;foo2@foo.com;foo@foo.com;Receiver;TradeConfirmed;" + body_not_confirmed = '"Trade";"foo2@foo.com";"foo@foo.com";"Receiver";"NeedConfirmation";' + body_confirmed = '"Trade";"foo2@foo.com";"foo@foo.com";"Receiver";"TradeConfirmed";' assert body_not_confirmed in csv_not_confirmed assert body_confirmed in csv_confirmed From bee420c1e7c79768443e5e0bc1a66491bcf66142 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 1 Aug 2022 20:40:42 +0200 Subject: [PATCH 8/9] fix tests quotes files --- tests/test_documents.py | 1 + tests/test_render_2_0.py | 11 +++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/test_documents.py b/tests/test_documents.py index 785e803a..5a4fa35c 100644 --- a/tests/test_documents.py +++ b/tests/test_documents.py @@ -399,6 +399,7 @@ def test_export_computer_monitor(user: UserClient): accept='text/csv', query=[('filter', {'type': ['ComputerMonitor']})], ) + f = StringIO(csv_str) obj_csv = csv.reader(f, f) export_csv = list(obj_csv) diff --git a/tests/test_render_2_0.py b/tests/test_render_2_0.py index d110736d..bcefe28b 100644 --- a/tests/test_render_2_0.py +++ b/tests/test_render_2_0.py @@ -1557,12 +1557,11 @@ def test_export_devices_lots(user3: UserClientFlask): with Path(__file__).parent.joinpath('files').joinpath( 'devices_lots.csv' ).open() as csv_file: - obj_csv = csv.reader(csv_file, delimiter=';', quotechar='"') - fixture_csv = list(obj_csv) + fixture_csv = [line.split(";") for line in csv_file.read().split("\n")] assert fixture_csv[0] == export_csv[0], 'Headers are not equal' assert fixture_csv[1][2:] == export_csv[1][2:], 'Computer information are not equal' - UUID(export_csv[1][1]) + UUID(export_csv[1][1].replace('"', '')) @pytest.mark.mvp @@ -1593,12 +1592,12 @@ def test_export_lots(user3: UserClientFlask): with Path(__file__).parent.joinpath('files').joinpath( 'lots.csv' ).open() as csv_file: - obj_csv = csv.reader(csv_file, delimiter=';', quotechar='"') - fixture_csv = list(obj_csv) + fixture_csv = [line.split(";") for line in csv_file.read().split("\n")] + assert fixture_csv[0] == export_csv[0], 'Headers are not equal' assert fixture_csv[1][1:] == export_csv[1][1:], 'Computer information are not equal' - UUID(export_csv[1][0]) + UUID(export_csv[1][0].replace('"', '')) @pytest.mark.mvp From 8728707bf7e8c8588202d03dac9591cd8a3c48fc Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 1 Aug 2022 20:54:26 +0200 Subject: [PATCH 9/9] fix csv files --- tests/files/basic-stock.csv | 4 ++-- tests/files/basic.csv | 4 ++-- tests/files/devices_lots.csv | 4 ++-- tests/files/lots.csv | 4 ++-- tests/files/proposal_extended_csv_report.csv | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/files/basic-stock.csv b/tests/files/basic-stock.csv index 4f43ddb5..2ef3b4e6 100644 --- a/tests/files/basic-stock.csv +++ b/tests/files/basic-stock.csv @@ -1,2 +1,2 @@ -Type;Chassis;Serial Number;Model;Manufacturer;Registered in;Physical state;Allocate state;Lifecycle state;Processor;RAM (MB);Data Storage Size (MB) -"""Desktop""";"""Microtower""";"""d1s""";"""d1ml""";"""d1mr""";Mon Aug 1 17:38:15 2022;;;;"""p1ml""";"""0""";"""0""" +"Type";"Chassis";"Serial Number";"Model";"Manufacturer";"Registered in";"Physical state";"Allocate state";"Lifecycle state";"Processor";"RAM (MB)";"Data Storage Size (MB)" +"Desktop";"Microtower";"d1s";"d1ml";"d1mr";"Mon Aug 1 20:20:51 2022";"";"";"";"p1ml";"0";"0" diff --git a/tests/files/basic.csv b/tests/files/basic.csv index 3d5c7815..6246c28e 100644 --- a/tests/files/basic.csv +++ b/tests/files/basic.csv @@ -1,2 +1,2 @@ -DHID;DocumentID;Public Link;Lots;Tag 1 Type;Tag 1 ID;Tag 1 Organization;Tag 2 Type;Tag 2 ID;Tag 2 Organization;Tag 3 Type;Tag 3 ID;Tag 3 Organization;Device Hardware ID;Device Type;Device Chassis;Device Serial Number;Device Model;Device Manufacturer;Registered in;Registered (process);Updated in (software);Updated in (web);Physical state;Allocate state;Lifecycle state;Processor;RAM (MB);Data Storage Size (MB);Processor 1;Processor 1 Manufacturer;Processor 1 Model;Processor 1 Serial Number;Processor 1 Number of cores;Processor 1 Speed (GHz);Benchmark Processor 1 (points);Benchmark ProcessorSysbench Processor 1 (points);Processor 2;Processor 2 Manufacturer;Processor 2 Model;Processor 2 Serial Number;Processor 2 Number of cores;Processor 2 Speed (GHz);Benchmark Processor 2 (points);Benchmark ProcessorSysbench Processor 2 (points);RamModule 1;RamModule 1 Manufacturer;RamModule 1 Model;RamModule 1 Serial Number;RamModule 1 Size (MB);RamModule 1 Speed (MHz);RamModule 2;RamModule 2 Manufacturer;RamModule 2 Model;RamModule 2 Serial Number;RamModule 2 Size (MB);RamModule 2 Speed (MHz);RamModule 3;RamModule 3 Manufacturer;RamModule 3 Model;RamModule 3 Serial Number;RamModule 3 Size (MB);RamModule 3 Speed (MHz);RamModule 4;RamModule 4 Manufacturer;RamModule 4 Model;RamModule 4 Serial Number;RamModule 4 Size (MB);RamModule 4 Speed (MHz);DataStorage 1;DataStorage 1 Manufacturer;DataStorage 1 Model;DataStorage 1 Serial Number;DataStorage 1 Size (MB);Erasure DataStorage 1;Erasure DataStorage 1 Serial Number;Erasure DataStorage 1 Size (MB);Erasure DataStorage 1 Software;Erasure DataStorage 1 Result;Erasure DataStorage 1 Certificate URL;Erasure DataStorage 1 Type;Erasure DataStorage 1 Method;Erasure DataStorage 1 Elapsed (hours);Erasure DataStorage 1 Date;Erasure DataStorage 1 Steps;Erasure DataStorage 1 Steps Start Time;Erasure DataStorage 1 Steps End Time;Benchmark DataStorage 1 Read Speed (MB/s);Benchmark DataStorage 1 Writing speed (MB/s);Test DataStorage 1 Software;Test DataStorage 1 Type;Test DataStorage 1 Result;Test DataStorage 1 Power cycle count;Test DataStorage 1 Lifetime (days);Test DataStorage 1 Power on hours;DataStorage 2;DataStorage 2 Manufacturer;DataStorage 2 Model;DataStorage 2 Serial Number;DataStorage 2 Size (MB);Erasure DataStorage 2;Erasure DataStorage 2 Serial Number;Erasure DataStorage 2 Size (MB);Erasure DataStorage 2 Software;Erasure DataStorage 2 Result;Erasure DataStorage 2 Certificate URL;Erasure DataStorage 2 Type;Erasure DataStorage 2 Method;Erasure DataStorage 2 Elapsed (hours);Erasure DataStorage 2 Date;Erasure DataStorage 2 Steps;Erasure DataStorage 2 Steps Start Time;Erasure DataStorage 2 Steps End Time;Benchmark DataStorage 2 Read Speed (MB/s);Benchmark DataStorage 2 Writing speed (MB/s);Test DataStorage 2 Software;Test DataStorage 2 Type;Test DataStorage 2 Result;Test DataStorage 2 Power cycle count;Test DataStorage 2 Lifetime (days);Test DataStorage 2 Power on hours;DataStorage 3;DataStorage 3 Manufacturer;DataStorage 3 Model;DataStorage 3 Serial Number;DataStorage 3 Size (MB);Erasure DataStorage 3;Erasure DataStorage 3 Serial Number;Erasure DataStorage 3 Size (MB);Erasure DataStorage 3 Software;Erasure DataStorage 3 Result;Erasure DataStorage 3 Certificate URL;Erasure DataStorage 3 Type;Erasure DataStorage 3 Method;Erasure DataStorage 3 Elapsed (hours);Erasure DataStorage 3 Date;Erasure DataStorage 3 Steps;Erasure DataStorage 3 Steps Start Time;Erasure DataStorage 3 Steps End Time;Benchmark DataStorage 3 Read Speed (MB/s);Benchmark DataStorage 3 Writing speed (MB/s);Test DataStorage 3 Software;Test DataStorage 3 Type;Test DataStorage 3 Result;Test DataStorage 3 Power cycle count;Test DataStorage 3 Lifetime (days);Test DataStorage 3 Power on hours;DataStorage 4;DataStorage 4 Manufacturer;DataStorage 4 Model;DataStorage 4 Serial Number;DataStorage 4 Size (MB);Erasure DataStorage 4;Erasure DataStorage 4 Serial Number;Erasure DataStorage 4 Size (MB);Erasure DataStorage 4 Software;Erasure DataStorage 4 Result;Erasure DataStorage 4 Certificate URL;Erasure DataStorage 4 Type;Erasure DataStorage 4 Method;Erasure DataStorage 4 Elapsed (hours);Erasure DataStorage 4 Date;Erasure DataStorage 4 Steps;Erasure DataStorage 4 Steps Start Time;Erasure DataStorage 4 Steps End Time;Benchmark DataStorage 4 Read Speed (MB/s);Benchmark DataStorage 4 Writing speed (MB/s);Test DataStorage 4 Software;Test DataStorage 4 Type;Test DataStorage 4 Result;Test DataStorage 4 Power cycle count;Test DataStorage 4 Lifetime (days);Test DataStorage 4 Power on hours;Motherboard 1;Motherboard 1 Manufacturer;Motherboard 1 Model;Motherboard 1 Serial Number;Display 1;Display 1 Manufacturer;Display 1 Model;Display 1 Serial Number;GraphicCard 1;GraphicCard 1 Manufacturer;GraphicCard 1 Model;GraphicCard 1 Serial Number;GraphicCard 1 Memory (MB);GraphicCard 2;GraphicCard 2 Manufacturer;GraphicCard 2 Model;GraphicCard 2 Serial Number;GraphicCard 2 Memory (MB);NetworkAdapter 1;NetworkAdapter 1 Manufacturer;NetworkAdapter 1 Model;NetworkAdapter 1 Serial Number;NetworkAdapter 2;NetworkAdapter 2 Manufacturer;NetworkAdapter 2 Model;NetworkAdapter 2 Serial Number;SoundCard 1;SoundCard 1 Manufacturer;SoundCard 1 Model;SoundCard 1 Serial Number;SoundCard 2;SoundCard 2 Manufacturer;SoundCard 2 Model;SoundCard 2 Serial Number;Device Rate;Device Range;Processor Rate;Processor Range;RAM Rate;RAM Range;Data Storage Rate;Data Storage Range;Benchmark RamSysbench (points) -"""O48N2""";"""""";"""http://localhost/devices/O48N2""";"""""";"""named""";"""O48N2""";"""FooOrg""";;;;;;;"""desktop-d1mr-d1ml-d1s""";"""Desktop""";"""Microtower""";"""d1s""";"""d1ml""";"""d1mr""";"""2022-08-01 17:32:08.476273+02:00""";"""Workbench 11.0""";"""2022-08-01 17:32:08.506933+02:00""";;;;;"""p1ml""";"""0""";"""0""";"""Processor 6: model p1ml, S/N p1s""";"""p1mr""";"""p1ml""";"""p1s""";"""""";"""1.6""";"""2410.0""";;;;;;;;;;"""RamModule 5: model rm1ml, S/N rm1s""";"""rm1mr""";"""rm1ml""";"""rm1s""";"""""";"""1333""";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"""GraphicCard 4: model gc1ml, S/N gc1s""";"""gc1mr""";"""gc1ml""";"""gc1s""";"""""";;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +"DHID";"DocumentID";"Public Link";"Lots";"Tag 1 Type";"Tag 1 ID";"Tag 1 Organization";"Tag 2 Type";"Tag 2 ID";"Tag 2 Organization";"Tag 3 Type";"Tag 3 ID";"Tag 3 Organization";"Device Hardware ID";"Device Type";"Device Chassis";"Device Serial Number";"Device Model";"Device Manufacturer";"Registered in";"Registered (process)";"Updated in (software)";"Updated in (web)";"Physical state";"Allocate state";"Lifecycle state";"Processor";"RAM (MB)";"Data Storage Size (MB)";"Processor 1";"Processor 1 Manufacturer";"Processor 1 Model";"Processor 1 Serial Number";"Processor 1 Number of cores";"Processor 1 Speed (GHz)";"Benchmark Processor 1 (points)";"Benchmark ProcessorSysbench Processor 1 (points)";"Processor 2";"Processor 2 Manufacturer";"Processor 2 Model";"Processor 2 Serial Number";"Processor 2 Number of cores";"Processor 2 Speed (GHz)";"Benchmark Processor 2 (points)";"Benchmark ProcessorSysbench Processor 2 (points)";"RamModule 1";"RamModule 1 Manufacturer";"RamModule 1 Model";"RamModule 1 Serial Number";"RamModule 1 Size (MB)";"RamModule 1 Speed (MHz)";"RamModule 2";"RamModule 2 Manufacturer";"RamModule 2 Model";"RamModule 2 Serial Number";"RamModule 2 Size (MB)";"RamModule 2 Speed (MHz)";"RamModule 3";"RamModule 3 Manufacturer";"RamModule 3 Model";"RamModule 3 Serial Number";"RamModule 3 Size (MB)";"RamModule 3 Speed (MHz)";"RamModule 4";"RamModule 4 Manufacturer";"RamModule 4 Model";"RamModule 4 Serial Number";"RamModule 4 Size (MB)";"RamModule 4 Speed (MHz)";"DataStorage 1";"DataStorage 1 Manufacturer";"DataStorage 1 Model";"DataStorage 1 Serial Number";"DataStorage 1 Size (MB)";"Erasure DataStorage 1";"Erasure DataStorage 1 Serial Number";"Erasure DataStorage 1 Size (MB)";"Erasure DataStorage 1 Software";"Erasure DataStorage 1 Result";"Erasure DataStorage 1 Certificate URL";"Erasure DataStorage 1 Type";"Erasure DataStorage 1 Method";"Erasure DataStorage 1 Elapsed (hours)";"Erasure DataStorage 1 Date";"Erasure DataStorage 1 Steps";"Erasure DataStorage 1 Steps Start Time";"Erasure DataStorage 1 Steps End Time";"Benchmark DataStorage 1 Read Speed (MB/s)";"Benchmark DataStorage 1 Writing speed (MB/s)";"Test DataStorage 1 Software";"Test DataStorage 1 Type";"Test DataStorage 1 Result";"Test DataStorage 1 Power cycle count";"Test DataStorage 1 Lifetime (days)";"Test DataStorage 1 Power on hours";"DataStorage 2";"DataStorage 2 Manufacturer";"DataStorage 2 Model";"DataStorage 2 Serial Number";"DataStorage 2 Size (MB)";"Erasure DataStorage 2";"Erasure DataStorage 2 Serial Number";"Erasure DataStorage 2 Size (MB)";"Erasure DataStorage 2 Software";"Erasure DataStorage 2 Result";"Erasure DataStorage 2 Certificate URL";"Erasure DataStorage 2 Type";"Erasure DataStorage 2 Method";"Erasure DataStorage 2 Elapsed (hours)";"Erasure DataStorage 2 Date";"Erasure DataStorage 2 Steps";"Erasure DataStorage 2 Steps Start Time";"Erasure DataStorage 2 Steps End Time";"Benchmark DataStorage 2 Read Speed (MB/s)";"Benchmark DataStorage 2 Writing speed (MB/s)";"Test DataStorage 2 Software";"Test DataStorage 2 Type";"Test DataStorage 2 Result";"Test DataStorage 2 Power cycle count";"Test DataStorage 2 Lifetime (days)";"Test DataStorage 2 Power on hours";"DataStorage 3";"DataStorage 3 Manufacturer";"DataStorage 3 Model";"DataStorage 3 Serial Number";"DataStorage 3 Size (MB)";"Erasure DataStorage 3";"Erasure DataStorage 3 Serial Number";"Erasure DataStorage 3 Size (MB)";"Erasure DataStorage 3 Software";"Erasure DataStorage 3 Result";"Erasure DataStorage 3 Certificate URL";"Erasure DataStorage 3 Type";"Erasure DataStorage 3 Method";"Erasure DataStorage 3 Elapsed (hours)";"Erasure DataStorage 3 Date";"Erasure DataStorage 3 Steps";"Erasure DataStorage 3 Steps Start Time";"Erasure DataStorage 3 Steps End Time";"Benchmark DataStorage 3 Read Speed (MB/s)";"Benchmark DataStorage 3 Writing speed (MB/s)";"Test DataStorage 3 Software";"Test DataStorage 3 Type";"Test DataStorage 3 Result";"Test DataStorage 3 Power cycle count";"Test DataStorage 3 Lifetime (days)";"Test DataStorage 3 Power on hours";"DataStorage 4";"DataStorage 4 Manufacturer";"DataStorage 4 Model";"DataStorage 4 Serial Number";"DataStorage 4 Size (MB)";"Erasure DataStorage 4";"Erasure DataStorage 4 Serial Number";"Erasure DataStorage 4 Size (MB)";"Erasure DataStorage 4 Software";"Erasure DataStorage 4 Result";"Erasure DataStorage 4 Certificate URL";"Erasure DataStorage 4 Type";"Erasure DataStorage 4 Method";"Erasure DataStorage 4 Elapsed (hours)";"Erasure DataStorage 4 Date";"Erasure DataStorage 4 Steps";"Erasure DataStorage 4 Steps Start Time";"Erasure DataStorage 4 Steps End Time";"Benchmark DataStorage 4 Read Speed (MB/s)";"Benchmark DataStorage 4 Writing speed (MB/s)";"Test DataStorage 4 Software";"Test DataStorage 4 Type";"Test DataStorage 4 Result";"Test DataStorage 4 Power cycle count";"Test DataStorage 4 Lifetime (days)";"Test DataStorage 4 Power on hours";"Motherboard 1";"Motherboard 1 Manufacturer";"Motherboard 1 Model";"Motherboard 1 Serial Number";"Display 1";"Display 1 Manufacturer";"Display 1 Model";"Display 1 Serial Number";"GraphicCard 1";"GraphicCard 1 Manufacturer";"GraphicCard 1 Model";"GraphicCard 1 Serial Number";"GraphicCard 1 Memory (MB)";"GraphicCard 2";"GraphicCard 2 Manufacturer";"GraphicCard 2 Model";"GraphicCard 2 Serial Number";"GraphicCard 2 Memory (MB)";"NetworkAdapter 1";"NetworkAdapter 1 Manufacturer";"NetworkAdapter 1 Model";"NetworkAdapter 1 Serial Number";"NetworkAdapter 2";"NetworkAdapter 2 Manufacturer";"NetworkAdapter 2 Model";"NetworkAdapter 2 Serial Number";"SoundCard 1";"SoundCard 1 Manufacturer";"SoundCard 1 Model";"SoundCard 1 Serial Number";"SoundCard 2";"SoundCard 2 Manufacturer";"SoundCard 2 Model";"SoundCard 2 Serial Number";"Device Rate";"Device Range";"Processor Rate";"Processor Range";"RAM Rate";"RAM Range";"Data Storage Rate";"Data Storage Range";"Benchmark RamSysbench (points)" +"O48N2";"";"http://localhost/devices/O48N2";"";"named";"O48N2";"FooOrg";"";"";"";"";"";"";"desktop-d1mr-d1ml-d1s";"Desktop";"Microtower";"d1s";"d1ml";"d1mr";"Mon Aug 1 20:23:53 2022";"Workbench 11.0";"2022-08-01 20:23:53.835857+02:00";"";"";"";"";"p1ml";"0";"0";"Processor 6: model p1ml, S/N p1s";"p1mr";"p1ml";"p1s";"";"1.6";"2410.0";"";"";"";"";"";"";"";"";"";"RamModule 5: model rm1ml, S/N rm1s";"rm1mr";"rm1ml";"rm1s";"";"1333";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"GraphicCard 4: model gc1ml, S/N gc1s";"gc1mr";"gc1ml";"gc1s";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"" diff --git a/tests/files/devices_lots.csv b/tests/files/devices_lots.csv index 5de2cc9f..d9bd6680 100644 --- a/tests/files/devices_lots.csv +++ b/tests/files/devices_lots.csv @@ -1,2 +1,2 @@ -DHID;Lot Id;Lot Name;Lot Type;Transfer Status;Transfer Code;Transfer Date;Transfer Creation Date;Transfer Update Date -O48N2;c43a0d06-0c77-4a74-9c95-086645fbc534;lot1;Temporary;;;;; +"DHID";"Lot Id";"Lot Name";"Lot Type";"Transfer Status";"Transfer Code";"Transfer Date";"Transfer Creation Date";"Transfer Update Date" +"O48N2";"b33c5a0d-bc80-453f-805a-560fab88a761";"lot1";"Temporary";"";"";"";"";"" diff --git a/tests/files/lots.csv b/tests/files/lots.csv index 9c2d7c5b..35c36a34 100644 --- a/tests/files/lots.csv +++ b/tests/files/lots.csv @@ -1,2 +1,2 @@ -Lot Id;Lot Name;Lot Type;Transfer Status;Transfer Code;Transfer Date;Transfer Creation Date;Transfer Update Date;Transfer Description;Devices Number;Devices Snapshots;Devices Placeholders;Delivery Note Number;Delivery Note Date;Delivery Note Units;Delivery Note Weight;Receiver Note Number;Receiver Note Date;Receiver Note Units;Receiver Note Weight -cca691c4-b221-4882-924c-30cd545c0182;lot1;Temporary;;;;;;;1;1;0;;;;;;;; +"Lot Id";"Lot Name";"Lot Type";"Transfer Status";"Transfer Code";"Transfer Date";"Transfer Creation Date";"Transfer Update Date";"Transfer Description";"Devices Number";"Devices Snapshots";"Devices Placeholders";"Delivery Note Number";"Delivery Note Date";"Delivery Note Units";"Delivery Note Weight";"Receiver Note Number";"Receiver Note Date";"Receiver Note Units";"Receiver Note Weight" +"d992faea-5411-4a47-9388-073d67e9ee2d";"lot1";"Temporary";"";"";"";"";"";"";"1";"1";"0";"";"";"";"";"";"";"";"" diff --git a/tests/files/proposal_extended_csv_report.csv b/tests/files/proposal_extended_csv_report.csv index b99804f5..350d06aa 100644 --- a/tests/files/proposal_extended_csv_report.csv +++ b/tests/files/proposal_extended_csv_report.csv @@ -1,3 +1,3 @@ -DHID;DocumentID;Public Link;Lots;Tag 1 Type;Tag 1 ID;Tag 1 Organization;Tag 2 Type;Tag 2 ID;Tag 2 Organization;Tag 3 Type;Tag 3 ID;Tag 3 Organization;Device Hardware ID;Device Type;Device Chassis;Device Serial Number;Device Model;Device Manufacturer;Registered in;Registered (process);Updated in (software);Updated in (web);Physical state;Allocate state;Lifecycle state;Processor;RAM (MB);Data Storage Size (MB);Processor 1;Processor 1 Manufacturer;Processor 1 Model;Processor 1 Serial Number;Processor 1 Number of cores;Processor 1 Speed (GHz);Benchmark Processor 1 (points);Benchmark ProcessorSysbench Processor 1 (points);Processor 2;Processor 2 Manufacturer;Processor 2 Model;Processor 2 Serial Number;Processor 2 Number of cores;Processor 2 Speed (GHz);Benchmark Processor 2 (points);Benchmark ProcessorSysbench Processor 2 (points);RamModule 1;RamModule 1 Manufacturer;RamModule 1 Model;RamModule 1 Serial Number;RamModule 1 Size (MB);RamModule 1 Speed (MHz);RamModule 2;RamModule 2 Manufacturer;RamModule 2 Model;RamModule 2 Serial Number;RamModule 2 Size (MB);RamModule 2 Speed (MHz);RamModule 3;RamModule 3 Manufacturer;RamModule 3 Model;RamModule 3 Serial Number;RamModule 3 Size (MB);RamModule 3 Speed (MHz);RamModule 4;RamModule 4 Manufacturer;RamModule 4 Model;RamModule 4 Serial Number;RamModule 4 Size (MB);RamModule 4 Speed (MHz);DataStorage 1;DataStorage 1 Manufacturer;DataStorage 1 Model;DataStorage 1 Serial Number;DataStorage 1 Size (MB);Erasure DataStorage 1;Erasure DataStorage 1 Serial Number;Erasure DataStorage 1 Size (MB);Erasure DataStorage 1 Software;Erasure DataStorage 1 Result;Erasure DataStorage 1 Certificate URL;Erasure DataStorage 1 Type;Erasure DataStorage 1 Method;Erasure DataStorage 1 Elapsed (hours);Erasure DataStorage 1 Date;Erasure DataStorage 1 Steps;Erasure DataStorage 1 Steps Start Time;Erasure DataStorage 1 Steps End Time;Benchmark DataStorage 1 Read Speed (MB/s);Benchmark DataStorage 1 Writing speed (MB/s);Test DataStorage 1 Software;Test DataStorage 1 Type;Test DataStorage 1 Result;Test DataStorage 1 Power cycle count;Test DataStorage 1 Lifetime (days);Test DataStorage 1 Power on hours;DataStorage 2;DataStorage 2 Manufacturer;DataStorage 2 Model;DataStorage 2 Serial Number;DataStorage 2 Size (MB);Erasure DataStorage 2;Erasure DataStorage 2 Serial Number;Erasure DataStorage 2 Size (MB);Erasure DataStorage 2 Software;Erasure DataStorage 2 Result;Erasure DataStorage 2 Certificate URL;Erasure DataStorage 2 Type;Erasure DataStorage 2 Method;Erasure DataStorage 2 Elapsed (hours);Erasure DataStorage 2 Date;Erasure DataStorage 2 Steps;Erasure DataStorage 2 Steps Start Time;Erasure DataStorage 2 Steps End Time;Benchmark DataStorage 2 Read Speed (MB/s);Benchmark DataStorage 2 Writing speed (MB/s);Test DataStorage 2 Software;Test DataStorage 2 Type;Test DataStorage 2 Result;Test DataStorage 2 Power cycle count;Test DataStorage 2 Lifetime (days);Test DataStorage 2 Power on hours;DataStorage 3;DataStorage 3 Manufacturer;DataStorage 3 Model;DataStorage 3 Serial Number;DataStorage 3 Size (MB);Erasure DataStorage 3;Erasure DataStorage 3 Serial Number;Erasure DataStorage 3 Size (MB);Erasure DataStorage 3 Software;Erasure DataStorage 3 Result;Erasure DataStorage 3 Certificate URL;Erasure DataStorage 3 Type;Erasure DataStorage 3 Method;Erasure DataStorage 3 Elapsed (hours);Erasure DataStorage 3 Date;Erasure DataStorage 3 Steps;Erasure DataStorage 3 Steps Start Time;Erasure DataStorage 3 Steps End Time;Benchmark DataStorage 3 Read Speed (MB/s);Benchmark DataStorage 3 Writing speed (MB/s);Test DataStorage 3 Software;Test DataStorage 3 Type;Test DataStorage 3 Result;Test DataStorage 3 Power cycle count;Test DataStorage 3 Lifetime (days);Test DataStorage 3 Power on hours;DataStorage 4;DataStorage 4 Manufacturer;DataStorage 4 Model;DataStorage 4 Serial Number;DataStorage 4 Size (MB);Erasure DataStorage 4;Erasure DataStorage 4 Serial Number;Erasure DataStorage 4 Size (MB);Erasure DataStorage 4 Software;Erasure DataStorage 4 Result;Erasure DataStorage 4 Certificate URL;Erasure DataStorage 4 Type;Erasure DataStorage 4 Method;Erasure DataStorage 4 Elapsed (hours);Erasure DataStorage 4 Date;Erasure DataStorage 4 Steps;Erasure DataStorage 4 Steps Start Time;Erasure DataStorage 4 Steps End Time;Benchmark DataStorage 4 Read Speed (MB/s);Benchmark DataStorage 4 Writing speed (MB/s);Test DataStorage 4 Software;Test DataStorage 4 Type;Test DataStorage 4 Result;Test DataStorage 4 Power cycle count;Test DataStorage 4 Lifetime (days);Test DataStorage 4 Power on hours;Motherboard 1;Motherboard 1 Manufacturer;Motherboard 1 Model;Motherboard 1 Serial Number;Display 1;Display 1 Manufacturer;Display 1 Model;Display 1 Serial Number;GraphicCard 1;GraphicCard 1 Manufacturer;GraphicCard 1 Model;GraphicCard 1 Serial Number;GraphicCard 1 Memory (MB);GraphicCard 2;GraphicCard 2 Manufacturer;GraphicCard 2 Model;GraphicCard 2 Serial Number;GraphicCard 2 Memory (MB);NetworkAdapter 1;NetworkAdapter 1 Manufacturer;NetworkAdapter 1 Model;NetworkAdapter 1 Serial Number;NetworkAdapter 2;NetworkAdapter 2 Manufacturer;NetworkAdapter 2 Model;NetworkAdapter 2 Serial Number;SoundCard 1;SoundCard 1 Manufacturer;SoundCard 1 Model;SoundCard 1 Serial Number;SoundCard 2;SoundCard 2 Manufacturer;SoundCard 2 Model;SoundCard 2 Serial Number;Device Rate;Device Range;Processor Rate;Processor Range;RAM Rate;RAM Range;Data Storage Rate;Data Storage Range;Benchmark RamSysbench (points) -"""O48N2""";"""""";"""http://localhost/devices/O48N2""";"""""";"""named""";"""O48N2""";"""FooOrg""";;;;;;;"""laptop-asustek_computer_inc-1001pxd-b8oaas048285-14:da:e9:42:f6:7b""";"""Laptop""";"""Netbook""";"""b8oaas048285""";"""1001pxd""";"""asustek computer inc.""";"""2022-08-01 17:33:17.769765+02:00""";"""Workbench 11.0a2""";"""2022-08-01 17:33:17.811660+02:00""";;;;;"""intel atom cpu n455 @ 2.66ghz""";"""1024""";"""238475""";"""Processor 6: model intel atom cpu n455 @ 2.66ghz, S/N None""";"""intel corp.""";"""intel atom cpu n455 @ 2.66ghz""";"""""";"""1""";"""2.667""";"""6666.24""";"""164.0803""";;;;;;;;;"""RamModule 10: model None, S/N None""";"""""";"""""";"""""";"""1024""";"""667""";;;;;;;;;;;;;;;;;;;"""HardDrive 11: model hts54322, S/N e2024242cv86mm""";"""hitachi""";"""hts54322""";"""e2024242cv86mm""";"""238475""";"""harddrive-hitachi-hts54322-e2024242cv86mm""";"""e2024242cv86mm""";"""238475""";"""Workbench 11.0a2""";"""Success""";;"""EraseBasic""";"""Shred""";"""1:16:49""";"""2022-08-01 17:33:17.763874+02:00""";"""✓ – StepRandom 1:16:49""";"""2018-07-03 11:15:22.257059+02:00""";"""2018-07-03 12:32:11.843190+02:00""";"""66.2""";"""21.8""";"""Workbench 11.0a2""";"""Short""";"""Failure""";"""""";"""""";"""0""";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"""Motherboard 12: model 1001pxd, S/N eee0123456720""";"""asustek computer inc.""";"""1001pxd""";"""eee0123456720""";;;;;"""GraphicCard 7: model atom processor d4xx/d5xx/n4xx/n5xx integrated graphics controller, S/N None""";"""intel corporation""";"""atom processor d4xx/d5xx/n4xx/n5xx integrated graphics controller""";"""""";"""256""";;;;;;"""NetworkAdapter 4: model ar9285 wireless network adapter, S/N 74:2f:68:8b:fd:c9""";"""qualcomm atheros""";"""ar9285 wireless network adapter""";"""74:2f:68:8b:fd:c9""";"""NetworkAdapter 5: model ar8152 v2.0 fast ethernet, S/N 14:da:e9:42:f6:7b""";"""qualcomm atheros""";"""ar8152 v2.0 fast ethernet""";"""14:da:e9:42:f6:7b""";"""SoundCard 8: model nm10/ich7 family high definition audio controller, S/N None""";"""intel corporation""";"""nm10/ich7 family high definition audio controller""";"""""";"""SoundCard 9: model usb 2.0 uvc vga webcam, S/N 0x0001""";"""azurewave""";"""usb 2.0 uvc vga webcam""";"""0x0001""";;;;;;;;;"""15.7188""" -"""J2MA2""";"""""";"""http://localhost/devices/J2MA2""";"""""";"""named""";"""J2MA2""";"""FooOrg""";;;;;;;"""laptop-asustek_computer_inc-1001pxd-b8oaas048287-14:da:e9:42:f6:7c""";"""Laptop""";"""Netbook""";"""b8oaas048287""";"""1001pxd""";"""asustek computer inc.""";"""2022-08-01 17:33:18.033570+02:00""";"""Workbench 11.0b11""";"""2022-08-01 17:33:18.072778+02:00""";;;;;"""intel atom cpu n455 @ 1.66ghz""";"""2048""";"""558558""";"""Processor 17: model intel atom cpu n455 @ 1.66ghz, S/N None""";"""intel corp.""";"""intel atom cpu n455 @ 1.66ghz""";"""""";"""1""";"""1.667""";"""6666.24""";"""164.0803""";;;;;;;;;"""RamModule 21: model None, S/N None""";"""""";"""""";"""""";"""1024""";"""667""";"""RamModule 22: model 48594d503131325336344350362d53362020, S/N 4f43487b""";"""hynix semiconductor""";"""48594d503131325336344350362d53362020""";"""4f43487b""";"""1024""";"""667""";;;;;;;;;;;;;"""HardDrive 23: model hts54322, S/N e2024242cv86hj""";"""hitachi""";"""hts54322""";"""e2024242cv86hj""";"""238475""";"""harddrive-hitachi-hts54322-e2024242cv86hj""";"""e2024242cv86hj""";"""238475""";"""Workbench 11.0b11""";"""Success""";;"""EraseBasic""";"""Shred""";"""1:16:49""";"""2022-08-01 17:33:18.023083+02:00""";"""✓ – StepRandom 1:16:49""";"""2018-07-03 11:15:22.257059+02:00""";"""2018-07-03 12:32:11.843190+02:00""";"""66.2""";"""21.8""";"""Workbench 11.0b11""";"""Extended""";"""Failure""";"""""";"""""";"""0""";"""DataStorage 24: model wdc wd1600bevt-2, S/N wd-wx11a80w7430""";"""western digital""";"""wdc wd1600bevt-2""";"""wd-wx11a80w7430""";"""160041""";"""datastorage-western_digital-wdc_wd1600bevt-2-wd-wx11a80w7430""";"""wd-wx11a80w7430""";"""160041""";"""Workbench 11.0b11""";"""Failure""";;"""EraseBasic""";"""Shred""";"""0:45:36""";"""2022-08-01 17:33:18.025473+02:00""";"""✓ – StepRandom 0:45:36""";"""2019-10-23 09:49:54.410830+02:00""";"""2019-10-23 10:35:31.400587+02:00""";"""41.6""";"""17.3""";"""Workbench 11.0b11""";"""Short""";"""Success""";"""5293""";"""195 days, 12:00:00""";"""4692""";"""SolidStateDrive 25: model wdc wd1600bevt-2, S/N wd-wx11a80w7430""";"""western digital""";"""wdc wd1600bevt-2""";"""wd-wx11a80w7430""";"""160042""";"""solidstatedrive-western_digital-wdc_wd1600bevt-2-wd-wx11a80w7430""";"""wd-wx11a80w7430""";"""160042""";"""Workbench 11.0b11""";"""Success""";;"""EraseSectors""";"""Badblocks""";"""1:46:03""";"""2022-08-01 17:33:18.029553+02:00""";"""✓ – StepRandom 0:46:03,✓ – StepZero 1:00:00""";"""2019-08-19 18:48:19.690458+02:00,2019-08-19 19:34:22.690458+02:00""";"""2019-08-19 19:34:22.930562+02:00,2019-08-19 20:34:22.930562+02:00""";"""41.1""";"""17.1""";"""Workbench 11.0b11""";"""Short""";"""Success""";"""5231""";"""194 days, 17:00:00""";"""4673""";;;;;;;;;;;;;;;;;;;;;;;;;;;"""Motherboard 26: model 1001pxd, S/N eee0123456789""";"""asustek computer inc.""";"""1001pxd""";"""eee0123456789""";"""""";"""auo ""auo""""";"""auo lcd monitor""";"""""";"""GraphicCard 18: model atom processor d4xx/d5xx/n4xx/n5xx integrated graphics controller, S/N None""";"""intel corporation""";"""atom processor d4xx/d5xx/n4xx/n5xx integrated graphics controller""";"""""";"""256""";;;;;;"""NetworkAdapter 15: model ar9285 wireless network adapter, S/N 74:2f:68:8b:fd:c8""";"""qualcomm atheros""";"""ar9285 wireless network adapter""";"""74:2f:68:8b:fd:c8""";"""NetworkAdapter 16: model ar8152 v2.0 fast ethernet, S/N 14:da:e9:42:f6:7c""";"""qualcomm atheros""";"""ar8152 v2.0 fast ethernet""";"""14:da:e9:42:f6:7c""";"""SoundCard 19: model nm10/ich7 family high definition audio controller, S/N None""";"""intel corporation""";"""nm10/ich7 family high definition audio controller""";"""""";"""SoundCard 20: model usb 2.0 uvc vga webcam, S/N 0x0001""";"""azurewave""";"""usb 2.0 uvc vga webcam""";"""0x0001""";;;;;;;;;"""15.7188""" +"DHID";"DocumentID";"Public Link";"Lots";"Tag 1 Type";"Tag 1 ID";"Tag 1 Organization";"Tag 2 Type";"Tag 2 ID";"Tag 2 Organization";"Tag 3 Type";"Tag 3 ID";"Tag 3 Organization";"Device Hardware ID";"Device Type";"Device Chassis";"Device Serial Number";"Device Model";"Device Manufacturer";"Registered in";"Registered (process)";"Updated in (software)";"Updated in (web)";"Physical state";"Allocate state";"Lifecycle state";"Processor";"RAM (MB)";"Data Storage Size (MB)";"Processor 1";"Processor 1 Manufacturer";"Processor 1 Model";"Processor 1 Serial Number";"Processor 1 Number of cores";"Processor 1 Speed (GHz)";"Benchmark Processor 1 (points)";"Benchmark ProcessorSysbench Processor 1 (points)";"Processor 2";"Processor 2 Manufacturer";"Processor 2 Model";"Processor 2 Serial Number";"Processor 2 Number of cores";"Processor 2 Speed (GHz)";"Benchmark Processor 2 (points)";"Benchmark ProcessorSysbench Processor 2 (points)";"RamModule 1";"RamModule 1 Manufacturer";"RamModule 1 Model";"RamModule 1 Serial Number";"RamModule 1 Size (MB)";"RamModule 1 Speed (MHz)";"RamModule 2";"RamModule 2 Manufacturer";"RamModule 2 Model";"RamModule 2 Serial Number";"RamModule 2 Size (MB)";"RamModule 2 Speed (MHz)";"RamModule 3";"RamModule 3 Manufacturer";"RamModule 3 Model";"RamModule 3 Serial Number";"RamModule 3 Size (MB)";"RamModule 3 Speed (MHz)";"RamModule 4";"RamModule 4 Manufacturer";"RamModule 4 Model";"RamModule 4 Serial Number";"RamModule 4 Size (MB)";"RamModule 4 Speed (MHz)";"DataStorage 1";"DataStorage 1 Manufacturer";"DataStorage 1 Model";"DataStorage 1 Serial Number";"DataStorage 1 Size (MB)";"Erasure DataStorage 1";"Erasure DataStorage 1 Serial Number";"Erasure DataStorage 1 Size (MB)";"Erasure DataStorage 1 Software";"Erasure DataStorage 1 Result";"Erasure DataStorage 1 Certificate URL";"Erasure DataStorage 1 Type";"Erasure DataStorage 1 Method";"Erasure DataStorage 1 Elapsed (hours)";"Erasure DataStorage 1 Date";"Erasure DataStorage 1 Steps";"Erasure DataStorage 1 Steps Start Time";"Erasure DataStorage 1 Steps End Time";"Benchmark DataStorage 1 Read Speed (MB/s)";"Benchmark DataStorage 1 Writing speed (MB/s)";"Test DataStorage 1 Software";"Test DataStorage 1 Type";"Test DataStorage 1 Result";"Test DataStorage 1 Power cycle count";"Test DataStorage 1 Lifetime (days)";"Test DataStorage 1 Power on hours";"DataStorage 2";"DataStorage 2 Manufacturer";"DataStorage 2 Model";"DataStorage 2 Serial Number";"DataStorage 2 Size (MB)";"Erasure DataStorage 2";"Erasure DataStorage 2 Serial Number";"Erasure DataStorage 2 Size (MB)";"Erasure DataStorage 2 Software";"Erasure DataStorage 2 Result";"Erasure DataStorage 2 Certificate URL";"Erasure DataStorage 2 Type";"Erasure DataStorage 2 Method";"Erasure DataStorage 2 Elapsed (hours)";"Erasure DataStorage 2 Date";"Erasure DataStorage 2 Steps";"Erasure DataStorage 2 Steps Start Time";"Erasure DataStorage 2 Steps End Time";"Benchmark DataStorage 2 Read Speed (MB/s)";"Benchmark DataStorage 2 Writing speed (MB/s)";"Test DataStorage 2 Software";"Test DataStorage 2 Type";"Test DataStorage 2 Result";"Test DataStorage 2 Power cycle count";"Test DataStorage 2 Lifetime (days)";"Test DataStorage 2 Power on hours";"DataStorage 3";"DataStorage 3 Manufacturer";"DataStorage 3 Model";"DataStorage 3 Serial Number";"DataStorage 3 Size (MB)";"Erasure DataStorage 3";"Erasure DataStorage 3 Serial Number";"Erasure DataStorage 3 Size (MB)";"Erasure DataStorage 3 Software";"Erasure DataStorage 3 Result";"Erasure DataStorage 3 Certificate URL";"Erasure DataStorage 3 Type";"Erasure DataStorage 3 Method";"Erasure DataStorage 3 Elapsed (hours)";"Erasure DataStorage 3 Date";"Erasure DataStorage 3 Steps";"Erasure DataStorage 3 Steps Start Time";"Erasure DataStorage 3 Steps End Time";"Benchmark DataStorage 3 Read Speed (MB/s)";"Benchmark DataStorage 3 Writing speed (MB/s)";"Test DataStorage 3 Software";"Test DataStorage 3 Type";"Test DataStorage 3 Result";"Test DataStorage 3 Power cycle count";"Test DataStorage 3 Lifetime (days)";"Test DataStorage 3 Power on hours";"DataStorage 4";"DataStorage 4 Manufacturer";"DataStorage 4 Model";"DataStorage 4 Serial Number";"DataStorage 4 Size (MB)";"Erasure DataStorage 4";"Erasure DataStorage 4 Serial Number";"Erasure DataStorage 4 Size (MB)";"Erasure DataStorage 4 Software";"Erasure DataStorage 4 Result";"Erasure DataStorage 4 Certificate URL";"Erasure DataStorage 4 Type";"Erasure DataStorage 4 Method";"Erasure DataStorage 4 Elapsed (hours)";"Erasure DataStorage 4 Date";"Erasure DataStorage 4 Steps";"Erasure DataStorage 4 Steps Start Time";"Erasure DataStorage 4 Steps End Time";"Benchmark DataStorage 4 Read Speed (MB/s)";"Benchmark DataStorage 4 Writing speed (MB/s)";"Test DataStorage 4 Software";"Test DataStorage 4 Type";"Test DataStorage 4 Result";"Test DataStorage 4 Power cycle count";"Test DataStorage 4 Lifetime (days)";"Test DataStorage 4 Power on hours";"Motherboard 1";"Motherboard 1 Manufacturer";"Motherboard 1 Model";"Motherboard 1 Serial Number";"Display 1";"Display 1 Manufacturer";"Display 1 Model";"Display 1 Serial Number";"GraphicCard 1";"GraphicCard 1 Manufacturer";"GraphicCard 1 Model";"GraphicCard 1 Serial Number";"GraphicCard 1 Memory (MB)";"GraphicCard 2";"GraphicCard 2 Manufacturer";"GraphicCard 2 Model";"GraphicCard 2 Serial Number";"GraphicCard 2 Memory (MB)";"NetworkAdapter 1";"NetworkAdapter 1 Manufacturer";"NetworkAdapter 1 Model";"NetworkAdapter 1 Serial Number";"NetworkAdapter 2";"NetworkAdapter 2 Manufacturer";"NetworkAdapter 2 Model";"NetworkAdapter 2 Serial Number";"SoundCard 1";"SoundCard 1 Manufacturer";"SoundCard 1 Model";"SoundCard 1 Serial Number";"SoundCard 2";"SoundCard 2 Manufacturer";"SoundCard 2 Model";"SoundCard 2 Serial Number";"Device Rate";"Device Range";"Processor Rate";"Processor Range";"RAM Rate";"RAM Range";"Data Storage Rate";"Data Storage Range";"Benchmark RamSysbench (points)" +"O48N2";"";"http://localhost/devices/O48N2";"";"named";"O48N2";"FooOrg";"";"";"";"";"";"";"laptop-asustek_computer_inc-1001pxd-b8oaas048285-14:da:e9:42:f6:7b";"Laptop";"Netbook";"b8oaas048285";"1001pxd";"asustek computer inc.";"Mon Aug 1 20:18:46 2022";"Workbench 11.0a2";"2022-08-01 20:18:46.209696+02:00";"";"";"";"";"intel atom cpu n455 @ 2.66ghz";"1024";"238475";"Processor 6: model intel atom cpu n455 @ 2.66ghz, S/N None";"intel corp.";"intel atom cpu n455 @ 2.66ghz";"";"1";"2.667";"6666.24";"164.0803";"";"";"";"";"";"";"";"";"RamModule 10: model None, S/N None";"";"";"";"1024";"667";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"HardDrive 11: model hts54322, S/N e2024242cv86mm";"hitachi";"hts54322";"e2024242cv86mm";"238475";"harddrive-hitachi-hts54322-e2024242cv86mm";"e2024242cv86mm";"238475";"Workbench 11.0a2";"Success";"";"EraseBasic";"Shred";"1:16:49";"2022-08-01 20:18:46.167257+02:00";"✓ – StepRandom 1:16:49";"2018-07-03 11:15:22.257059+02:00";"2018-07-03 12:32:11.843190+02:00";"66.2";"21.8";"Workbench 11.0a2";"Short";"Failure";"";"";"0";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"Motherboard 12: model 1001pxd, S/N eee0123456720";"asustek computer inc.";"1001pxd";"eee0123456720";"";"";"";"";"GraphicCard 7: model atom processor d4xx/d5xx/n4xx/n5xx integrated graphics controller, S/N None";"intel corporation";"atom processor d4xx/d5xx/n4xx/n5xx integrated graphics controller";"";"256";"";"";"";"";"";"NetworkAdapter 4: model ar9285 wireless network adapter, S/N 74:2f:68:8b:fd:c9";"qualcomm atheros";"ar9285 wireless network adapter";"74:2f:68:8b:fd:c9";"NetworkAdapter 5: model ar8152 v2.0 fast ethernet, S/N 14:da:e9:42:f6:7b";"qualcomm atheros";"ar8152 v2.0 fast ethernet";"14:da:e9:42:f6:7b";"SoundCard 8: model nm10/ich7 family high definition audio controller, S/N None";"intel corporation";"nm10/ich7 family high definition audio controller";"";"SoundCard 9: model usb 2.0 uvc vga webcam, S/N 0x0001";"azurewave";"usb 2.0 uvc vga webcam";"0x0001";"";"";"";"";"";"";"";"";"15.7188" +"J2MA2";"";"http://localhost/devices/J2MA2";"";"named";"J2MA2";"FooOrg";"";"";"";"";"";"";"laptop-asustek_computer_inc-1001pxd-b8oaas048287-14:da:e9:42:f6:7c";"Laptop";"Netbook";"b8oaas048287";"1001pxd";"asustek computer inc.";"Mon Aug 1 20:18:46 2022";"Workbench 11.0b11";"2022-08-01 20:18:46.453306+02:00";"";"";"";"";"intel atom cpu n455 @ 1.66ghz";"2048";"558558";"Processor 17: model intel atom cpu n455 @ 1.66ghz, S/N None";"intel corp.";"intel atom cpu n455 @ 1.66ghz";"";"1";"1.667";"6666.24";"164.0803";"";"";"";"";"";"";"";"";"RamModule 21: model None, S/N None";"";"";"";"1024";"667";"RamModule 22: model 48594d503131325336344350362d53362020, S/N 4f43487b";"hynix semiconductor";"48594d503131325336344350362d53362020";"4f43487b";"1024";"667";"";"";"";"";"";"";"";"";"";"";"";"";"HardDrive 23: model hts54322, S/N e2024242cv86hj";"hitachi";"hts54322";"e2024242cv86hj";"238475";"harddrive-hitachi-hts54322-e2024242cv86hj";"e2024242cv86hj";"238475";"Workbench 11.0b11";"Success";"";"EraseBasic";"Shred";"1:16:49";"2022-08-01 20:18:46.408888+02:00";"✓ – StepRandom 1:16:49";"2018-07-03 11:15:22.257059+02:00";"2018-07-03 12:32:11.843190+02:00";"66.2";"21.8";"Workbench 11.0b11";"Extended";"Failure";"";"";"0";"DataStorage 24: model wdc wd1600bevt-2, S/N wd-wx11a80w7430";"western digital";"wdc wd1600bevt-2";"wd-wx11a80w7430";"160041";"datastorage-western_digital-wdc_wd1600bevt-2-wd-wx11a80w7430";"wd-wx11a80w7430";"160041";"Workbench 11.0b11";"Failure";"";"EraseBasic";"Shred";"0:45:36";"2022-08-01 20:18:46.410949+02:00";"✓ – StepRandom 0:45:36";"2019-10-23 09:49:54.410830+02:00";"2019-10-23 10:35:31.400587+02:00";"41.6";"17.3";"Workbench 11.0b11";"Short";"Success";"5293";"195 days, 12:00:00";"4692";"SolidStateDrive 25: model wdc wd1600bevt-2, S/N wd-wx11a80w7430";"western digital";"wdc wd1600bevt-2";"wd-wx11a80w7430";"160042";"solidstatedrive-western_digital-wdc_wd1600bevt-2-wd-wx11a80w7430";"wd-wx11a80w7430";"160042";"Workbench 11.0b11";"Success";"";"EraseSectors";"Badblocks";"1:46:03";"2022-08-01 20:18:46.415788+02:00";"✓ – StepRandom 0:46:03,✓ – StepZero 1:00:00";"2019-08-19 18:48:19.690458+02:00,2019-08-19 19:34:22.690458+02:00";"2019-08-19 19:34:22.930562+02:00,2019-08-19 20:34:22.930562+02:00";"41.1";"17.1";"Workbench 11.0b11";"Short";"Success";"5231";"194 days, 17:00:00";"4673";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"Motherboard 26: model 1001pxd, S/N eee0123456789";"asustek computer inc.";"1001pxd";"eee0123456789";"";"auo ""auo""";"auo lcd monitor";"";"GraphicCard 18: model atom processor d4xx/d5xx/n4xx/n5xx integrated graphics controller, S/N None";"intel corporation";"atom processor d4xx/d5xx/n4xx/n5xx integrated graphics controller";"";"256";"";"";"";"";"";"NetworkAdapter 15: model ar9285 wireless network adapter, S/N 74:2f:68:8b:fd:c8";"qualcomm atheros";"ar9285 wireless network adapter";"74:2f:68:8b:fd:c8";"NetworkAdapter 16: model ar8152 v2.0 fast ethernet, S/N 14:da:e9:42:f6:7c";"qualcomm atheros";"ar8152 v2.0 fast ethernet";"14:da:e9:42:f6:7c";"SoundCard 19: model nm10/ich7 family high definition audio controller, S/N None";"intel corporation";"nm10/ich7 family high definition audio controller";"";"SoundCard 20: model usb 2.0 uvc vga webcam, S/N 0x0001";"azurewave";"usb 2.0 uvc vga webcam";"0x0001";"";"";"";"";"";"";"";"";"15.7188"