Skip to content

Commit 70b54e0

Browse files
fholgerarmintaenzertng
authored andcommitted
Fix output file paths in pipeline run
Signed-off-by: Holger Frydrych <[email protected]>
1 parent f886a48 commit 70b54e0

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

tests/spdx/examples/test_examples.py

+6-15
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ def cleanup_output_files():
1313

1414
files_to_delete = ["spdx2_to_3.jsonld", "my_spdx_document.spdx.json", "converted_format.xml", "graph.png"]
1515
for file in files_to_delete:
16-
output_file = os.path.join(os.path.dirname(__file__), file)
17-
if os.path.exists(output_file):
18-
os.remove(output_file)
16+
if os.path.exists(file):
17+
os.remove(file)
1918

2019

2120
def run_example(example_file: str):
@@ -30,25 +29,19 @@ def test_spdx2_parse_file():
3029
@pytest.mark.usefixtures("cleanup_output_files")
3130
def test_spdx2_convert_to_spdx3():
3231
run_example("spdx2_convert_to_spdx3.py")
33-
34-
output_file = os.path.join(os.path.dirname(__file__), "spdx2_to_3.jsonld")
35-
assert os.path.exists(output_file)
32+
assert os.path.exists("spdx2_to_3.jsonld")
3633

3734

3835
@pytest.mark.usefixtures("cleanup_output_files")
3936
def test_spdx2_document_from_scratch():
4037
run_example("spdx2_document_from_scratch.py")
41-
42-
output_file = os.path.join(os.path.dirname(__file__), "my_spdx_document.spdx.json")
43-
assert os.path.exists(output_file)
38+
assert os.path.exists("my_spdx_document.spdx.json")
4439

4540

4641
@pytest.mark.usefixtures("cleanup_output_files")
4742
def test_spdx2_convert_format():
4843
run_example("spdx2_convert_format.py")
49-
50-
output_file = os.path.join(os.path.dirname(__file__), "converted_format.xml")
51-
assert os.path.exists(output_file)
44+
assert os.path.exists("converted_format.xml")
5245

5346

5447
@pytest.mark.usefixtures("cleanup_output_files")
@@ -60,6 +53,4 @@ def test_spdx2_generate_graph():
6053
pytest.skip("Missing optional dependencies")
6154

6255
run_example("spdx2_generate_graph.py")
63-
64-
output_file = os.path.join(os.path.dirname(__file__), "graph.png")
65-
assert os.path.exists(output_file)
56+
assert os.path.exists("graph.png")

0 commit comments

Comments
 (0)