# Path: fparser/api.py
# def get_reader(input, isfree=None, isstrict=None, include_dirs = None, source_only = None,
#                ignore_comments = True):
# def parse(input, isfree=None, isstrict=None, include_dirs = None, source_only = None,
#           ignore_comments = True, analyze=True):
# def walk(stmt, depth=-1, _initial_depth = None):


from fparser import api

def test_default_private():
    src = '''\
module mod1
private
integer :: i
contains
subroutine s1
end subroutine
end module mod1
'''
    mod1 = api.parse(src, isfree=True, isstrict=False).content[0]
    assert mod1.get_provides() == {}, repr(mod1.get_provides())
    assert list(mod1.a.variables.keys()) == ['i']
    assert list(mod1.a.module_subprogram.keys()) == ['s1']

def test_access_spec():
    src = '''\
module mod1
private
integer, public :: i
integer :: j, k
public :: j, s1
contains
subroutine s1
end subroutine
subroutine s2
end subroutine
end module mod1
'''

# Path: fparser/api.py
# def get_reader(input, isfree=None, isstrict=None, include_dirs = None, source_only = None,
#                ignore_comments = True):
# def parse(input, isfree=None, isstrict=None, include_dirs = None, source_only = None,
#           ignore_comments = True, analyze=True):
# def walk(stmt, depth=-1, _initial_depth = None):


# Path: fparser/tests/test_mod_private.py
from fparser import api


def test_default_private():
    src = '''\
module mod1
private
integer :: i
contains
subroutine s1
end subroutine
end module mod1
'''
    mod1 = api.parse(src, isfree=True, isstrict=False).content[0]
    assert mod1.get_provides() == {}, repr(mod1.get_provides())
    assert list(mod1.a.variables.keys()) == ['i']
    assert list(mod1.a.module_subprogram.keys()) == ['s1']

def test_access_spec():
    src = '''\
module mod1
private
integer, public :: i
integer :: j, k
public :: j, s1
contains
subroutine s1
end subroutine
subroutine s2
end subroutine
end module mod1
'''

    mod1 = api.parse(src, isfree=True, isstrict=False).content[0]