Skip to content

Commit 75d20d2

Browse files
committed
tests
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent 5a6c3eb commit 75d20d2

File tree

44 files changed

+268
-107
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+268
-107
lines changed

tests/_data/models.py

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,7 +1050,10 @@ def get_bom_with_multiple_licenses() -> Bom:
10501050
def get_bom_with_tools() -> Bom:
10511051
return _make_bom(
10521052
metadata=BomMetaData(
1053-
tools=[Tool(name='test-tool', version='1.33.7')]
1053+
tools=(
1054+
Tool(name='test-tool-b', version='1.33.7'),
1055+
Tool(name='test-tool-a', version='23.42'),
1056+
)
10541057
)
10551058
)
10561059

@@ -1059,8 +1062,12 @@ def get_bom_with_tools_with_component_migrate() -> Bom:
10591062
return _make_bom(
10601063
metadata=BomMetaData(
10611064
tools=ToolsRepository(
1062-
components=[Component(type=ComponentType.APPLICATION, author='adobe',
1063-
name='test-component', version='1.2.3', bom_ref='my-component')]
1065+
components=(
1066+
Component(type=ComponentType.APPLICATION, group='adobe',
1067+
name='test-component', version='1.2.3', bom_ref='test-component'),
1068+
Component(type=ComponentType.APPLICATION, group='acme',
1069+
name='other-component', bom_ref='other-component'),
1070+
)
10641071
)
10651072
)
10661073
)
@@ -1070,7 +1077,10 @@ def get_bom_with_tools_with_service_migrate() -> Bom:
10701077
return _make_bom(
10711078
metadata=BomMetaData(
10721079
tools=ToolsRepository(
1073-
services=[Service(name='test-service', bom_ref='my-service')]
1080+
services=(
1081+
Service(name='test-service', bom_ref='test-service'),
1082+
Service(name='other-service', bom_ref='other-service'),
1083+
)
10741084
)
10751085
)
10761086
)
@@ -1080,9 +1090,16 @@ def get_bom_with_tools_with_component_and_service_migrate() -> Bom:
10801090
return _make_bom(
10811091
metadata=BomMetaData(
10821092
tools=ToolsRepository(
1083-
components=[Component(type=ComponentType.APPLICATION, author='adobe',
1084-
name='test-component', version='1.2.3', bom_ref='my-component')],
1085-
services=[Service(name='test-service', bom_ref='my-service')]
1093+
components=(
1094+
Component(type=ComponentType.APPLICATION, group='adobe',
1095+
name='test-component', version='1.2.3', bom_ref='test-component'),
1096+
Component(type=ComponentType.APPLICATION, group='acme',
1097+
name='other-component', bom_ref='other-component'),
1098+
),
1099+
services=(
1100+
Service(name='test-service', bom_ref='test-service'),
1101+
Service(name='other-service', bom_ref='other-service'),
1102+
)
10861103
)
10871104
)
10881105
)
@@ -1174,6 +1191,7 @@ def get_bom_for_issue_630_empty_property() -> Bom:
11741191
)
11751192
})
11761193

1194+
11771195
# ---
11781196

11791197

tests/_data/own/json/1.5/bom_with_tool_with_component_and_service.json

Lines changed: 0 additions & 37 deletions
This file was deleted.

tests/_data/own/xml/1.5/bom_with_tool_with_component_and_service.xml

Lines changed: 0 additions & 24 deletions
This file was deleted.

tests/_data/snapshots/get_bom_with_tools-1.2.json.bin

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
"timestamp": "2023-01-07T13:44:32.312678+00:00",
44
"tools": [
55
{
6-
"name": "test-tool",
6+
"name": "test-tool-a",
7+
"version": "23.42"
8+
},
9+
{
10+
"name": "test-tool-b",
711
"version": "1.33.7"
812
}
913
]

tests/_data/snapshots/get_bom_with_tools-1.2.xml.bin

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
<timestamp>2023-01-07T13:44:32.312678+00:00</timestamp>
55
<tools>
66
<tool>
7-
<name>test-tool</name>
7+
<name>test-tool-a</name>
8+
<version>23.42</version>
9+
</tool>
10+
<tool>
11+
<name>test-tool-b</name>
812
<version>1.33.7</version>
913
</tool>
1014
</tools>

tests/_data/snapshots/get_bom_with_tools-1.3.json.bin

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
"timestamp": "2023-01-07T13:44:32.312678+00:00",
44
"tools": [
55
{
6-
"name": "test-tool",
6+
"name": "test-tool-a",
7+
"version": "23.42"
8+
},
9+
{
10+
"name": "test-tool-b",
711
"version": "1.33.7"
812
}
913
]

tests/_data/snapshots/get_bom_with_tools-1.3.xml.bin

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
<timestamp>2023-01-07T13:44:32.312678+00:00</timestamp>
55
<tools>
66
<tool>
7-
<name>test-tool</name>
7+
<name>test-tool-a</name>
8+
<version>23.42</version>
9+
</tool>
10+
<tool>
11+
<name>test-tool-b</name>
812
<version>1.33.7</version>
913
</tool>
1014
</tools>

tests/_data/snapshots/get_bom_with_tools-1.4.json.bin

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
"timestamp": "2023-01-07T13:44:32.312678+00:00",
44
"tools": [
55
{
6-
"name": "test-tool",
6+
"name": "test-tool-a",
7+
"version": "23.42"
8+
},
9+
{
10+
"name": "test-tool-b",
711
"version": "1.33.7"
812
}
913
]

tests/_data/snapshots/get_bom_with_tools-1.4.xml.bin

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
<timestamp>2023-01-07T13:44:32.312678+00:00</timestamp>
55
<tools>
66
<tool>
7-
<name>test-tool</name>
7+
<name>test-tool-a</name>
8+
<version>23.42</version>
9+
</tool>
10+
<tool>
11+
<name>test-tool-b</name>
812
<version>1.33.7</version>
913
</tool>
1014
</tools>

tests/_data/snapshots/get_bom_with_tools-1.5.json.bin

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
"timestamp": "2023-01-07T13:44:32.312678+00:00",
44
"tools": [
55
{
6-
"name": "test-tool",
6+
"name": "test-tool-a",
7+
"version": "23.42"
8+
},
9+
{
10+
"name": "test-tool-b",
711
"version": "1.33.7"
812
}
913
]

0 commit comments

Comments
 (0)