def test_conf_to_configparser_and_back(): confs = [C().to_conf() for C in comp_list] parser = ConfigParser() for c in confs: c.add_section_to_parser(parser) conf2 = ConfigSection.parser_to_confs(parser) assert conf2 == confs
def test_minimal_example(): parser = ConfigParser() parser.read("examples/minimal_working_example/minimal_conf.conf") components = [ conf.make() for conf in ConfigSection.parser_to_confs(parser) ] assert components == [ TimeGridConf(1e-7, 1e-9, 1e-9), SpatialMeshConf((5, 5, 15), (0.5, 0.5, 1.5)), ParticleInteractionModelConf('noninteracting'), BoundaryConditionsConf(0), ExternalFieldUniformConf('mgn_uni', 'magnetic'), ExternalFieldUniformConf('el_uni', 'electric'), OutputFileConf('example_', '.h5') ]