adding test

This commit is contained in:
Cayo Puigdefabregas 2020-10-19 13:06:54 +02:00
parent 7c0ccd5794
commit 10843b907d
3 changed files with 193 additions and 0 deletions

View File

@ -0,0 +1,2 @@
System ID,Public Link,Tag 1 Type,Tag 1 ID,Tag 1 Organization,Hardware ID,Device Type,Device Chassis,Serial Number,Model,Manufacturer,Registered in,Registered (process),Updated in (software),Updated in (web):,Physical state,Trading state,Price,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),Processor 2,Processor 2 Manufacturer,Processor 2 Model,Processor 2 Serial Number,RamModule 1,RamModule 1 Manufacturer,RamModule 1 Model,RamModule 1 Serial Number,RamModule 2,RamModule 2 Manufacturer,RamModule 2 Model,RamModule 2 Serial Number,RamModule 3,RamModule 3 Manufacturer,RamModule 3 Model,RamModule 3 Serial Number,RamModule 4,RamModule 4 Manufacturer,RamModule 4 Model,RamModule 4 Serial Number,DataStorage 1,DataStorage 1 Manufacturer,Data Storage 1 Model,Data Storage 1 Serial Number,Erasure Data Storage 1 Serial Number,Erasure Data Storage 1 Size,Erasure Data Storage 1 Software,Erasure Data Storage 1 Result,Erasure Data Storage 1 Type,Erasure Data Storage 1 Method,Erasure Data Storage 1 Elapsed,Erasure Data Storage 1 Date,Erasure Data Storage 1 Steps,Erasure Data Storage 1 Steps Start Time,Erasure Data Storage 1 Steps End Time,DataStorage 2,DataStorage 2 Manufacturer,DataStorage 2 Model,DataStorage 2 Serial Number,Erasure Data Storage 2 Serial Number,Erasure Data Storage 2 Size,Erasure Data Storage 2 Software,Erasure Data Storage 2 Result,Erasure Data Storage 2 Type,Erasure Data Storage 2 Method,Erasure Data Storage 2 Elapsed,Erasure Data Storage 2 Date,Erasure Data Storage 2 Steps,Erasure Data Storage 2 Steps Start Time,Erasure Data Storage 2 Steps End Time,DataStorage 3,DataStorage 3 Manufacturer,DataStorage 3 Model,DataStorage 3 Serial Number,Erasure Data Storage 3 Serial Number,Erasure Data Storage 3 Size,Erasure Data Storage 3 Software,Erasure Data Storage 3 Result,Erasure Data Storage 3 Type,Erasure Data Storage 3 Method,Erasure Data Storage 3 Elapsed,Erasure Data Storage 3 Date,Erasure Data Storage 3 Steps,Erasure Data Storage 3 Steps Start Time,Erasure Data Storage 3 Steps End Time,DataStorage 4,DataStorage 4 Manufacturer,DataStorage 4 Model,DataStorage 4 Serial Number,Erasure Data Storage 4 Serial Number,Erasure Data Storage 4 Size,Erasure Data Storage 4 Software,Erasure Data Storage 4 Result,Erasure Data Storage 4 Type,Erasure Data Storage 4 Method,Erasure Data Storage 4 Elapsed,Erasure Data Storage 4 Date,Erasure Data Storage 4 Steps,Erasure Data Storage 4 Steps Start Time,Erasure Data Storage 4 Steps End Time,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,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 Processor (points),Benchmark ProcessorSysbench (points),Benchmark RamSysbench (points),Benchmark DataStorage Write Speed (MB/s),Benchmark DataStorage Read Speed (MB/s),Test Data Storage 1 Software,Test Data Storage 1 Type,Test Data Storage 1 Result,Test Data Staorage 1 Power on (hours used),Test Data Storage 1 Lifetime remaining (percentage),Test Stress Software,Test Stress Time (minutes)
421,api.usody.com/usody/devices/421,unamed,BG3O9,My Organization ,laptop-d1m-d1mr-d1sn,Laptop,Netbook,d1sn,d1m,d1mr,Sat Aug 29 12:18:46 2020,Software,Sat Aug 29 12:18:46 2020,,Ready,,44.10 €,intel atom cpu n450 @ 1.66ghz,8432,512000,"Processor 125: model intel atom cpu n450 @ 1.66ghz, S/N None",,,,1,1.0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"GraphicCard 126: model atom processor d4xx/d5xx/n4xx/n5xx integrated graphics controller, S/N None",,,,,,,,,,,,,,,,,"SoundCard 127: model nm10/ich7 family high definition audio controller, S/N None",,,,"SoundCard 128: model 1.3m webcam, S/N None",,,,1.47,Low,1.18,Low,1.53,Low,3.3,High,,,,,,Workbench version,,,,,Workbench version,
1 System ID Public Link Tag 1 Type Tag 1 ID Tag 1 Organization Hardware ID Device Type Device Chassis Serial Number Model Manufacturer Registered in Registered (process) Updated in (software) Updated in (web): Physical state Trading state Price 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) Processor 2 Processor 2 Manufacturer Processor 2 Model Processor 2 Serial Number RamModule 1 RamModule 1 Manufacturer RamModule 1 Model RamModule 1 Serial Number RamModule 2 RamModule 2 Manufacturer RamModule 2 Model RamModule 2 Serial Number RamModule 3 RamModule 3 Manufacturer RamModule 3 Model RamModule 3 Serial Number RamModule 4 RamModule 4 Manufacturer RamModule 4 Model RamModule 4 Serial Number DataStorage 1 DataStorage 1 Manufacturer Data Storage 1 Model Data Storage 1 Serial Number Erasure Data Storage 1 Serial Number Erasure Data Storage 1 Size Erasure Data Storage 1 Software Erasure Data Storage 1 Result Erasure Data Storage 1 Type Erasure Data Storage 1 Method Erasure Data Storage 1 Elapsed Erasure Data Storage 1 Date Erasure Data Storage 1 Steps Erasure Data Storage 1 Steps Start Time Erasure Data Storage 1 Steps End Time DataStorage 2 DataStorage 2 Manufacturer DataStorage 2 Model DataStorage 2 Serial Number Erasure Data Storage 2 Serial Number Erasure Data Storage 2 Size Erasure Data Storage 2 Software Erasure Data Storage 2 Result Erasure Data Storage 2 Type Erasure Data Storage 2 Method Erasure Data Storage 2 Elapsed Erasure Data Storage 2 Date Erasure Data Storage 2 Steps Erasure Data Storage 2 Steps Start Time Erasure Data Storage 2 Steps End Time DataStorage 3 DataStorage 3 Manufacturer DataStorage 3 Model DataStorage 3 Serial Number Erasure Data Storage 3 Serial Number Erasure Data Storage 3 Size Erasure Data Storage 3 Software Erasure Data Storage 3 Result Erasure Data Storage 3 Type Erasure Data Storage 3 Method Erasure Data Storage 3 Elapsed Erasure Data Storage 3 Date Erasure Data Storage 3 Steps Erasure Data Storage 3 Steps Start Time Erasure Data Storage 3 Steps End Time DataStorage 4 DataStorage 4 Manufacturer DataStorage 4 Model DataStorage 4 Serial Number Erasure Data Storage 4 Serial Number Erasure Data Storage 4 Size Erasure Data Storage 4 Software Erasure Data Storage 4 Result Erasure Data Storage 4 Type Erasure Data Storage 4 Method Erasure Data Storage 4 Elapsed Erasure Data Storage 4 Date Erasure Data Storage 4 Steps Erasure Data Storage 4 Steps Start Time Erasure Data Storage 4 Steps End Time 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 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 Processor (points) Benchmark ProcessorSysbench (points) Benchmark RamSysbench (points) Benchmark DataStorage Write Speed (MB/s) Benchmark DataStorage Read Speed (MB/s) Test Data Storage 1 Software Test Data Storage 1 Type Test Data Storage 1 Result Test Data Staorage 1 Power on (hours used) Test Data Storage 1 Lifetime remaining (percentage) Test Stress Software Test Stress Time (minutes)
2 421 api.usody.com/usody/devices/421 unamed BG3O9 My Organization laptop-d1m-d1mr-d1sn Laptop Netbook d1sn d1m d1mr Sat Aug 29 12:18:46 2020 Software Sat Aug 29 12:18:46 2020 Ready 44.10 € intel atom cpu n450 @ 1.66ghz 8432 512000 Processor 125: model intel atom cpu n450 @ 1.66ghz, S/N None 1 1.0 GraphicCard 126: model atom processor d4xx/d5xx/n4xx/n5xx integrated graphics controller, S/N None SoundCard 127: model nm10/ich7 family high definition audio controller, S/N None SoundCard 128: model 1.3m webcam, S/N None 1.47 Low 1.18 Low 1.53 Low 3.3 High Workbench version Workbench version

View File

@ -0,0 +1,162 @@
{
"components": [
{
"type": "NetworkAdapter",
"model": "AR9285 Wireless Network Adapter",
"serialNumber": "74:2f:68:8b:fd:c8",
"manufacturer": "Qualcomm Atheros",
"wireless": true,
"actions": []
},
{
"type": "NetworkAdapter",
"model": "AR8152 v2.0 Fast Ethernet",
"serialNumber": "14:da:e9:42:f6:7c",
"manufacturer": "Qualcomm Atheros",
"speed": 100,
"wireless": false,
"actions": []
},
{
"type": "Processor",
"cores": 1,
"threads": 1,
"address": 64,
"model": "Intel Atom CPU N455 @ 1.66GHz",
"serialNumber": null,
"manufacturer": "Intel Corp.",
"speed": 1.667,
"actions": [
{
"type": "BenchmarkProcessorSysbench",
"rate": 164.0803,
"elapsed": 164
},
{
"type": "BenchmarkProcessor",
"rate": 6666.24,
"elapsed": 0
}
]
},
{
"type": "GraphicCard",
"model": "Atom Processor D4xx/D5xx/N4xx/N5xx Integrated Graphics Controller",
"serialNumber": null,
"memory": 256.0,
"manufacturer": "Intel Corporation",
"actions": []
},
{
"type": "SoundCard",
"model": "NM10/ICH7 Family High Definition Audio Controller",
"serialNumber": null,
"manufacturer": "Intel Corporation",
"actions": []
},
{
"type": "SoundCard",
"model": "USB 2.0 UVC VGA WebCam",
"serialNumber": "0x0001",
"manufacturer": "Azurewave",
"actions": []
},
{
"type": "RamModule",
"format": "DIMM",
"model": null,
"size": 1024,
"interface": "DDR2",
"serialNumber": null,
"manufacturer": null,
"speed": 667.0,
"actions": []
},
{
"type": "HardDrive",
"model": "HTS54322",
"size": 238475,
"interface": "ATA",
"serialNumber": "E2024242CV86HJ",
"manufacturer": "Hitachi",
"actions": [
{
"type": "BenchmarkDataStorage",
"elapsed": 16,
"writeSpeed": 21.8,
"readSpeed": 66.2
},
{
"type": "TestDataStorage",
"length": "Short",
"elapsed": 2,
"severity": "Error",
"status": "Unspecified Error. Self-test not started."
},
{
"type": "EraseBasic",
"steps": [
{
"type": "StepRandom",
"startTime": "2018-07-03T09:15:22.257059+00:00",
"severity": "Info",
"endTime": "2018-07-03T10:32:11.843190+00:00"
}
],
"startTime": "2018-07-03T09:15:22.256074+00:00",
"severity": "Info",
"endTime": "2018-07-03T10:32:11.848455+00:00"
}
]
},
{
"type": "Motherboard",
"serial": 1,
"firewire": 0,
"model": "1001PXD",
"slots": 2,
"pcmcia": 0,
"serialNumber": "Eee0123456789",
"usb": 5,
"manufacturer": "ASUSTeK Computer INC.",
"actions": [
{
"type": "TestBios",
"accessRange": "C"
}
]
}
],
"elapsed": 4875,
"uuid": "c058e8d2-fb92-47cb-a4b7-522b75561135",
"version": "11.0a2",
"type": "Snapshot",
"software": "Workbench",
"endTime": "2018-07-03T09:10:57.034598+00:00",
"device": {
"type": "Laptop",
"model": "1001PXD",
"serialNumber": "B8OAAS048286",
"manufacturer": "ASUSTeK Computer INC.",
"chassis": "Netbook",
"actions": [
{
"type": "BenchmarkRamSysbench",
"rate": 15.7188,
"elapsed": 16
},
{
"type": "StressTest",
"severity": "Info",
"elapsed": 60
},
{
"appearanceRange": "B",
"functionalityRange": "A",
"type": "VisualTest"
}
]
},
"closed": false
}

View File

@ -132,6 +132,35 @@ def test_export_full_snapshot(user: UserClient):
assert fixture_csv[1] == export_csv[1], 'Computer information are not equal' assert fixture_csv[1] == export_csv[1], 'Computer information are not equal'
@pytest.mark.mvp
def test_export_extended(user: UserClient):
"""Test a export device with all information and a lot of components."""
snapshot, _ = user.post(file('real-eee-1001pxd.snapshot.12'), res=Snapshot)
csv_str, _ = user.get(res=documents.DocumentDef.t,
item='devices/',
accept='text/csv',
query=[('filter', {'type': ['Computer']})])
f = StringIO(csv_str)
obj_csv = csv.reader(f, f)
export_csv = list(obj_csv)
# Open fixture csv and transform to list
with Path(__file__).parent.joinpath('files').joinpath(
'proposal_extended_csv_report.csv').open() as csv_file:
obj_csv = csv.reader(csv_file)
fixture_csv = list(obj_csv)
assert isinstance(datetime.strptime(export_csv[1][8], '%c'), datetime), \
'Register in field is not a datetime'
# Pop dates fields from csv lists to compare them
fixture_csv[1] = fixture_csv[1][:8] + fixture_csv[1][9:]
export_csv[1] = export_csv[1][:8] + export_csv[1][9:]
assert fixture_csv[0] == export_csv[0], 'Headers are not equal'
assert fixture_csv[1] == export_csv[1], 'Computer information are not equal'
@pytest.mark.mvp @pytest.mark.mvp
def test_export_empty(user: UserClient): def test_export_empty(user: UserClient):
"""Test to check works correctly exporting csv without any information, """Test to check works correctly exporting csv without any information,