@@ -76,3 +76,69 @@ def test_v_source_parse_owasp_1(self):
76
76
VulnerabilitySourceType .get_from_vector ('OWASP/K9:M1:O0:Z2/D1:X1:W1:L3/C2:I1:A1:T1/F1:R1:S2:P3/50' ),
77
77
VulnerabilitySourceType .OWASP
78
78
)
79
+
80
+ def test_v_source_get_localised_vector_cvss3_1 (self ):
81
+ self .assertEqual (
82
+ VulnerabilitySourceType .CVSS_V3 .get_localised_vector (vector = 'CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N' ),
83
+ 'AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N'
84
+ )
85
+
86
+ def test_v_source_get_localised_vector_cvss3_2 (self ):
87
+ self .assertEqual (
88
+ VulnerabilitySourceType .CVSS_V3 .get_localised_vector (vector = 'CVSS:3.0AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N' ),
89
+ 'AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N'
90
+ )
91
+
92
+ def test_v_source_get_localised_vector_cvss3_3 (self ):
93
+ self .assertEqual (
94
+ VulnerabilitySourceType .CVSS_V3 .get_localised_vector (vector = 'AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N' ),
95
+ 'AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N'
96
+ )
97
+
98
+ def test_v_source_get_localised_vector_cvss2_1 (self ):
99
+ self .assertEqual (
100
+ VulnerabilitySourceType .CVSS_V2 .get_localised_vector (vector = 'CVSS:2.0/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N' ),
101
+ 'AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N'
102
+ )
103
+
104
+ def test_v_source_get_localised_vector_cvss2_2 (self ):
105
+ self .assertEqual (
106
+ VulnerabilitySourceType .CVSS_V2 .get_localised_vector (vector = 'CVSS:2.1AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N' ),
107
+ 'AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N'
108
+ )
109
+
110
+ def test_v_source_get_localised_vector_cvss2_3 (self ):
111
+ self .assertEqual (
112
+ VulnerabilitySourceType .CVSS_V2 .get_localised_vector (vector = 'AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N' ),
113
+ 'AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N'
114
+ )
115
+
116
+ def test_v_source_get_localised_vector_owasp_1 (self ):
117
+ self .assertEqual (
118
+ VulnerabilitySourceType .OWASP .get_localised_vector (vector = 'OWASP/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N' ),
119
+ 'AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N'
120
+ )
121
+
122
+ def test_v_source_get_localised_vector_owasp_2 (self ):
123
+ self .assertEqual (
124
+ VulnerabilitySourceType .OWASP .get_localised_vector (vector = 'OWASPAV:L/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N' ),
125
+ 'AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N'
126
+ )
127
+
128
+ def test_v_source_get_localised_vector_owasp_3 (self ):
129
+ self .assertEqual (
130
+ VulnerabilitySourceType .OWASP .get_localised_vector (vector = 'AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N' ),
131
+ 'AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N'
132
+ )
133
+
134
+ def test_v_source_get_localised_vector_other_1 (self ):
135
+ self .assertEqual (
136
+ VulnerabilitySourceType .OPEN_FAIR .get_localised_vector (vector = 'SOMETHING_OR_OTHER' ),
137
+ 'SOMETHING_OR_OTHER'
138
+ )
139
+
140
+ def test_v_source_get_localised_vector_other_2 (self ):
141
+ self .assertEqual (
142
+ VulnerabilitySourceType .OTHER .get_localised_vector (vector = 'SOMETHING_OR_OTHER' ),
143
+ 'SOMETHING_OR_OTHER'
144
+ )
0 commit comments