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


import pytest
import gromacs.run
from .datafiles import datafile

from __future__ import division, absolute_import, print_function




class Test_check_mdrun_success(object):
    @staticmethod
    def test_no_logfile():
        assert gromacs.run.check_mdrun_success("bogus_file.log") is None

    @staticmethod
    def test_success_Gromacs4():
        assert gromacs.run.check_mdrun_success(datafile('gromacs4_success.log')) is True

    @staticmethod
    def test_incomplete_Gromacs4():
        assert gromacs.run.check_mdrun_success(datafile('gromacs4_incomplete.log')) is False

    @staticmethod
    def test_success_Gromacs5():
        assert gromacs.run.check_mdrun_success(datafile('gromacs5_success.log')) is True

    @staticmethod
    def test_incomplete_Gromacs5():
        assert gromacs.run.check_mdrun_success(datafile('gromacs5_incomplete.log')) is False

# The following tests need an existing Gromacs environment. They should run
# with either Gromacs 4 or Gromacs 5


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


# Path: tests/test_run.py
import pytest
import gromacs.run
from .datafiles import datafile


from __future__ import division, absolute_import, print_function




class Test_check_mdrun_success(object):
    @staticmethod
    def test_no_logfile():
        assert gromacs.run.check_mdrun_success("bogus_file.log") is None

    @staticmethod
    def test_success_Gromacs4():
        assert gromacs.run.check_mdrun_success(datafile('gromacs4_success.log')) is True

    @staticmethod
    def test_incomplete_Gromacs4():
        assert gromacs.run.check_mdrun_success(datafile('gromacs4_incomplete.log')) is False

    @staticmethod
    def test_success_Gromacs5():
        assert gromacs.run.check_mdrun_success(datafile('gromacs5_success.log')) is True

    @staticmethod
    def test_incomplete_Gromacs5():
        assert gromacs.run.check_mdrun_success(datafile('gromacs5_incomplete.log')) is False

# The following tests need an existing Gromacs environment. They should run
# with either Gromacs 4 or Gromacs 5


def test_MDRunner():