@@ -41,7 +41,7 @@ def test_tool_with_component_and_service_load_json(self) -> None:
41
41
'bom_with_tool_with_component_and_service.json' )
42
42
with open (test_file , encoding = 'UTF-8' ) as f :
43
43
bom_json = json_loads (f .read ())
44
- bom = Bom .from_json (bom_json ) # type: ignore[attr-defined]
44
+ bom = Bom .from_json (bom_json ) # type: ignore[attr-defined]
45
45
self .assertTupleEqual (
46
46
tuple (bom .metadata .tools .components ),
47
47
tuple (expected .metadata .tools .components ), 'components' )
@@ -68,23 +68,14 @@ def test_tool_with_component_and_service_load_xml(self) -> None:
68
68
tuple (bom .metadata .tools .tools ),
69
69
tuple (expected .metadata .tools .tools ), 'tools' )
70
70
71
- def test_invalid_tool_repo_properties (self ) -> None :
72
- with self .assertRaises (MutuallyExclusivePropertiesException ):
73
- ToolsRepository (
74
- components = [Component (name = 'test-component' )],
75
- services = [Service (name = 'test-service' )],
76
- tools = [Tool (name = 'test-tool' )]
77
- )
78
-
79
- def test_assign_component_with_existing_tool (self ) -> None :
80
- tr = ToolsRepository (tools = [Tool ()])
81
- with self .assertRaises (MutuallyExclusivePropertiesException ):
82
- tr .components = SortedSet ([Component (name = 'test-component' )])
83
-
84
- def test_assign_service_with_existing_tool (self ) -> None :
85
- tr = ToolsRepository (tools = [Tool ()])
86
- with self .assertRaises (MutuallyExclusivePropertiesException ):
87
- tr .services = SortedSet ([Service (name = 'test-service' )])
71
+ def test_init (self ) -> None :
72
+ cs = (Component (name = 'test-component' ),)
73
+ ss = (Service (name = 'test-service' ),)
74
+ ts = (Tool (name = 'test-tool' ),)
75
+ tr = ToolsRepository (components = cs , services = ss , tools = ts )
76
+ self .assertTupleEqual (cs , tuple (tr .components ))
77
+ self .assertTupleEqual (ss , tuple (tr .services ))
78
+ self .assertTupleEqual (ts , tuple (tr .tools ))
88
79
89
80
def test_unequal_different_type (self ) -> None :
90
81
tr = ToolsRepository ()
@@ -117,11 +108,6 @@ def test_equal(self) -> None:
117
108
tr2 .tools .add (t )
118
109
self .assertTrue (tr1 == tr2 )
119
110
120
- def test_assign_tool_with_existing_component (self ) -> None :
121
- tr = ToolsRepository (components = SortedSet ([Component (name = 'test-component' )]))
122
- with self .assertRaises (MutuallyExclusivePropertiesException ):
123
- tr .tools = SortedSet ([Tool ()])
124
-
125
111
def test_proper_service_provider_conversion (self ) -> None :
126
112
o = OrganizationalEntity (name = 'test-org' )
127
113
s = Service (name = 'test-service' , provider = o )
0 commit comments