File size: 1,225 Bytes
9d54b72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import filecmp
import os
from pathlib import Path

import pytest

from vcell_cli_utils import wrapper

testdata = [
    ("Aavani2019_BIOMD0000000876_vcell_7.5.0.27.omex",
     "Aavani2019_BIOMD0000000876_vcell_7.5.0.27.report.json"),
    ("VerySimple_vcell_7.5.0.27.omex",
     "VerySimple_vcell_7.5.0.27.report.json"),
    ("eungdamrong_and_Iyengar_BiophysJ_vcell_7.5.0.30.omex",
     "eungdamrong_and_Iyengar_BiophysJ_vcell_7.5.0.30.report.json")
]


@pytest.mark.parametrize("input_omex,expected_report", testdata)
def test_wrapper_validate_omex(input_omex: str, expected_report: str) -> None:
    temp_path: Path = Path(__file__).parent.parent
    omex_file: Path = Path(__file__).parent / "fixtures" / "validation" / input_omex
    expected_report_file: Path = Path(__file__).parent / "fixtures" / "validation" / expected_report
    generated_report_file: Path = Path(__file__).parent / "fixtures" / "problem.report"

    if generated_report_file.exists():
        os.remove(generated_report_file)

    wrapper.validateOmex(str(omex_file), str(temp_path), str(generated_report_file))

    filecmp.clear_cache()
    bSame: bool = filecmp.cmp(expected_report_file, generated_report_file, shallow=False)


    assert bSame