File: test_merge.py

package info (click to toggle)
junit2html 31.0.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 608 kB
  • sloc: xml: 3,208; python: 1,075; makefile: 6; sh: 5
file content (17 lines) | stat: -rw-r--r-- 563 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
"""Test the merge utility"""
import os
from junit2htmlreport import runner
from pathlib import Path
TESTS = Path(__file__).parent


def test_merge_folder(tmp_path):
    outfile = os.path.join(tmp_path, "test-merged.xml")
    outmatrix = os.path.join(tmp_path, "matrix.html")
    runner.run(["--merge", outfile, str(TESTS)])
    runner.run(["--theme", "dark", outfile])
    assert os.path.exists(f"{outfile}.html")

    tests = list([str(x) for x in TESTS.glob("*.xml")])
    runner.run(["--report-matrix", outmatrix] + tests)
    assert os.path.exists(outmatrix)