# Path: tests/datafiles.py
# def datafile(name):
#     return resource_filename(__name__, os.path.join("data", name))


import gromacs
import pytest
from numpy.testing import assert_equal
from ..datafiles import datafile
# GromacsWrapper: test_example.py
# Copyright (c) 2009 Oliver Beckstein <orbeckst@gmail.com>
# Released under the GNU Public License 3 (or higher, your choice)
# See the file COPYING for details.




@pytest.fixture(
    params=['original', 'nofilename', 'written']
)
def SIMPLE_NDX(request, tmpdir):
    ndx = gromacs.fileformats.ndx.NDX(datafile('simple.ndx'))

    if request.param == 'written':
        out = str(tmpdir.join('out.ndx'))

        ndx.write(out)
        ndx = gromacs.fileformats.ndx.NDX(out)
    elif request.param == 'nofilename':
        ndx = gromacs.fileformats.ndx.NDX()

# Path: tests/datafiles.py
# def datafile(name):
#     return resource_filename(__name__, os.path.join("data", name))


# Path: tests/fileformats/test_ndx.py
import gromacs
import pytest
from numpy.testing import assert_equal
from ..datafiles import datafile

# GromacsWrapper: test_example.py
# Copyright (c) 2009 Oliver Beckstein <orbeckst@gmail.com>
# Released under the GNU Public License 3 (or higher, your choice)
# See the file COPYING for details.




@pytest.fixture(
    params=['original', 'nofilename', 'written']
)
def SIMPLE_NDX(request, tmpdir):
    ndx = gromacs.fileformats.ndx.NDX(datafile('simple.ndx'))

    if request.param == 'written':
        out = str(tmpdir.join('out.ndx'))

        ndx.write(out)
        ndx = gromacs.fileformats.ndx.NDX(out)
    elif request.param == 'nofilename':
        ndx = gromacs.fileformats.ndx.NDX()

        ndx.read(datafile('simple.ndx'))