27
27
from cyclonedx .schema import OutputFormat , SchemaVersion
28
28
from cyclonedx .validation import get_instance as get_validator
29
29
30
- UndefinedFormatVersion = {(OutputFormat .JSON , SchemaVersion .V1_1 ), (OutputFormat .JSON , SchemaVersion .V1_0 ), }
30
+ UNDEFINED_FORMAT_VERSION = {
31
+ (OutputFormat .JSON , SchemaVersion .V1_1 ),
32
+ (OutputFormat .JSON , SchemaVersion .V1_0 ),
33
+ }
31
34
32
35
33
36
@ddt
@@ -36,7 +39,7 @@ class TestGetInstance(TestCase):
36
39
@named_data (* ([f'{ f .name } { v .name } ' , f , v ]
37
40
for f , v
38
41
in product (OutputFormat , SchemaVersion )
39
- if (f , v ) not in UndefinedFormatVersion ))
42
+ if (f , v ) not in UNDEFINED_FORMAT_VERSION ))
40
43
@unpack
41
44
def test_as_expected (self , of : OutputFormat , sv : SchemaVersion ) -> None :
42
45
validator = get_validator (of , sv )
@@ -45,7 +48,7 @@ def test_as_expected(self, of: OutputFormat, sv: SchemaVersion) -> None:
45
48
46
49
@data (
47
50
* (('foo' , sv , (TypeError , "unexpected output_format: 'foo'" )) for sv in SchemaVersion ),
48
- * ((f , v , (ValueError , f'unsupported schema_version: { v } ' )) for f , v in UndefinedFormatVersion )
51
+ * ((f , v , (ValueError , f'unsupported schema_version: { v } ' )) for f , v in UNDEFINED_FORMAT_VERSION )
49
52
)
50
53
@unpack
51
54
def test_fails_on_wrong_args (self , of : OutputFormat , sv : SchemaVersion , raisesRegex : Tuple ) -> None :
0 commit comments