def METHOD_NAME():
    '''Tests the module info object.'''
    mod_info = ModuleInfo("a_mod", "file_for_a")
    assert mod_info.filename == "file_for_a"
    assert mod_info._source_code is None
    with pytest.raises(ModuleInfoError) as err:
        mod_info.get_source_code()
    assert ("Could not find file 'file_for_a' when trying to read source "
            "code for module 'a_mod'" in str(err.value))
    # Try to read the file a_mod.f90, which is contained in the d1 directory
    mod_man = ModuleManager.get()
    mod_man.add_search_path("d1")
    mod_info = mod_man.get_module_info("a_mod")
    assert isinstance(mod_info, ModuleInfo)
    assert mod_info._source_code is None
    source_code = mod_info.get_source_code()
    assert source_code.startswith("module a_mod")
    # Make sure the source code is cached:
    assert mod_info._source_code.startswith("module a_mod")
    assert "end module a_mod" in mod_info._source_code
    # Now access the parse tree:
    assert mod_info._parse_tree is None
    parse_tree = mod_info.get_parse_tree()
    assert mod_info._parse_tree is parse_tree
    assert isinstance(mod_info._parse_tree, Fortran2003.Program)