@@ -41,7 +41,7 @@ def test_tool_with_component_and_service_load_json(self) -> None:
4141 'bom_with_tool_with_component_and_service.json' )
4242 with open (test_file , encoding = 'UTF-8' ) as f :
4343 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]
4545 self .assertTupleEqual (
4646 tuple (bom .metadata .tools .components ),
4747 tuple (expected .metadata .tools .components ), 'components' )
@@ -68,23 +68,14 @@ def test_tool_with_component_and_service_load_xml(self) -> None:
6868 tuple (bom .metadata .tools .tools ),
6969 tuple (expected .metadata .tools .tools ), 'tools' )
7070
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 ))
8879
8980 def test_unequal_different_type (self ) -> None :
9081 tr = ToolsRepository ()
@@ -117,11 +108,6 @@ def test_equal(self) -> None:
117108 tr2 .tools .add (t )
118109 self .assertTrue (tr1 == tr2 )
119110
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-
125111 def test_proper_service_provider_conversion (self ) -> None :
126112 o = OrganizationalEntity (name = 'test-org' )
127113 s = Service (name = 'test-service' , provider = o )
0 commit comments