# Path: paratemp/tools.py
# @contextmanager
# def cd(new_dir):
#     prev_dir = os.getcwd()
#     os.chdir(os.path.expanduser(new_dir))
#     try:
#         yield
#     finally:
#         os.chdir(prev_dir)


import os
import py
import pytest
import re
from paratemp.tools import cd
        from paratemp.sim_setup import get_gro_files
        from paratemp.sim_setup import get_gro_files
    from paratemp.sim_setup.sim_setup import _job_info_from_qsub
        from paratemp.sim_setup.sim_setup import _update_num
        from paratemp.sim_setup.sim_setup import _update_num
        from paratemp.exceptions import InputError
        from paratemp.sim_setup import get_n_solvent
        from paratemp.sim_setup import get_n_solvent
        from paratemp.sim_setup import get_n_solvent
        from paratemp.sim_setup import get_solv_count_top
        from paratemp.sim_setup import get_solv_count_top
        from paratemp.sim_setup import set_solv_count_top, get_solv_count_top
        from paratemp.sim_setup import set_solv_count_top, get_solv_count_top
        from paratemp.sim_setup import set_solv_count_top, \
            get_solv_count_top
        from paratemp.sim_setup import set_solv_count_top
        from paratemp.sim_setup.sim_setup import _get_n_top
        from paratemp.exceptions import InputError
        from paratemp.sim_setup.sim_setup import _make_sge_line
        from paratemp.sim_setup import make_gromacs_sub_script
        from paratemp.sim_setup import make_gromacs_sub_script
        from paratemp.sim_setup.sim_setup import _get_mdrun_line
        from paratemp.sim_setup.sim_setup import _get_sge_basic_lines
        from paratemp.sim_setup import make_gromacs_sub_script
# you may not use this file except in compliance with the License.     #
# You may obtain a copy of the License at                              #
#                                                                      #
#    http://www.apache.org/licenses/LICENSE-2.0                        #
#                                                                      #
# Unless required by applicable law or agreed to in writing, software  #
# distributed under the License is distributed on an "AS IS" BASIS,    #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or      #
# implied.                                                             #
# See the License for the specific language governing permissions and  #
# limitations under the License.                                       #
#                                                                      #
########################################################################

from __future__ import absolute_import




class TestGetGroFiles(object):

    def test_get_gro_files(self, pt_run_dir):
        with cd(pt_run_dir):
            gros = get_gro_files(trr_base='PT-out',
                                 tpr_base='TOPO/nvt',
                                 time=2)
            assert len(gros) == 2
            assert gros == ['PT-out0.gro', 'PT-out1.gro']

    def test_raises(self, pt_run_dir):

# Path: paratemp/tools.py
# @contextmanager
# def cd(new_dir):
#     prev_dir = os.getcwd()
#     os.chdir(os.path.expanduser(new_dir))
#     try:
#         yield
#     finally:
#         os.chdir(prev_dir)


# Path: tests/test_sim_setup/test_sim_setup.py
import os
import py
import pytest
import re
from paratemp.tools import cd
        from paratemp.sim_setup import get_gro_files
        from paratemp.sim_setup import get_gro_files
    from paratemp.sim_setup.sim_setup import _job_info_from_qsub
        from paratemp.sim_setup.sim_setup import _update_num
        from paratemp.sim_setup.sim_setup import _update_num
        from paratemp.exceptions import InputError
        from paratemp.sim_setup import get_n_solvent
        from paratemp.sim_setup import get_n_solvent
        from paratemp.sim_setup import get_n_solvent
        from paratemp.sim_setup import get_solv_count_top
        from paratemp.sim_setup import get_solv_count_top
        from paratemp.sim_setup import set_solv_count_top, get_solv_count_top
        from paratemp.sim_setup import set_solv_count_top, get_solv_count_top
        from paratemp.sim_setup import set_solv_count_top, \
            get_solv_count_top
        from paratemp.sim_setup import set_solv_count_top
        from paratemp.sim_setup.sim_setup import _get_n_top
        from paratemp.exceptions import InputError
        from paratemp.sim_setup.sim_setup import _make_sge_line
        from paratemp.sim_setup import make_gromacs_sub_script
        from paratemp.sim_setup import make_gromacs_sub_script
        from paratemp.sim_setup.sim_setup import _get_mdrun_line
        from paratemp.sim_setup.sim_setup import _get_sge_basic_lines
        from paratemp.sim_setup import make_gromacs_sub_script

# you may not use this file except in compliance with the License.     #
# You may obtain a copy of the License at                              #
#                                                                      #
#    http://www.apache.org/licenses/LICENSE-2.0                        #
#                                                                      #
# Unless required by applicable law or agreed to in writing, software  #
# distributed under the License is distributed on an "AS IS" BASIS,    #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or      #
# implied.                                                             #
# See the License for the specific language governing permissions and  #
# limitations under the License.                                       #
#                                                                      #
########################################################################

from __future__ import absolute_import




class TestGetGroFiles(object):

    def test_get_gro_files(self, pt_run_dir):
        with cd(pt_run_dir):
            gros = get_gro_files(trr_base='PT-out',
                                 tpr_base='TOPO/nvt',
                                 time=2)
            assert len(gros) == 2
            assert gros == ['PT-out0.gro', 'PT-out1.gro']

    def test_raises(self, pt_run_dir):

        with cd(pt_run_dir):