def test_correct_input_output3(self): data = json.load(open(self.filename)) data[1]["sensitivity"] = 4 self.assertEqual(Criticality.highest_criticality_asset(data), data[1])
def test_correct_input_output1(self): asset = { "otherdata1": "something", "impact": { "confidentiality": "3", "id": "POWER-STATION-BIL1", "integrity": "4", "availability": "5" }, "otherdata2": "something2", "sensitivity": 3 } self.assertEqual(Criticality.calculate_asset_criticality(asset), 48)
def test_sensitivity_missing(self): asset = { "otherdata1": "something", "impact": { "confidentiality": "2", "id": "POWER-STATION-BIL1", "integrity": "3", "availability": "2" }, "otherdata2": "something2", } self.assertEqual(Criticality.calculate_asset_criticality(asset), 36)