Skip to content

test_topas_converter

converter.tests.topas.test_topas_converter

test_if_config_created

test_if_config_created(
    topas_parser, project_topas_json, tmp_path
)

Check if topas_config.txt file created

Source code in yaptide/converter/tests/topas/test_topas_converter.py
83
84
85
86
87
88
def test_if_config_created(topas_parser: Parser, project_topas_json: dict, tmp_path: Path) -> None:
    """Check if topas_config.txt file created"""
    output_file = tmp_path / 'topas_config.txt'
    run_parser(topas_parser, project_topas_json, tmp_path)
    with output_file.open(mode='r') as f:
        assert f.read() == _expected_topas_input_content

test_if_parser_created

test_if_parser_created(topas_parser)

Check if parser created.

Source code in yaptide/converter/tests/topas/test_topas_converter.py
75
76
77
78
79
80
def test_if_parser_created(topas_parser: Parser) -> None:
    """Check if parser created."""
    assert topas_parser is not None
    assert topas_parser.info['simulator'] == 'topas'
    assert topas_parser.info['version'] == ''
    assert topas_parser.info['label'] == ''

topas_parser

topas_parser()

Just a parser fixture.

Source code in yaptide/converter/tests/topas/test_topas_converter.py
69
70
71
72
@pytest.fixture(scope='session')
def topas_parser() -> Parser:
    """Just a parser fixture."""
    return get_parser_from_str('topas')