import unittest

from simlammps.lammps_process import LammpsProcess


class TestLammpsProcess(unittest.TestCase):

    def setUp(self):
        self.lammps = LammpsProcess()

    def test_run_hello_world(self):
        command = "print \"hello world\""
        self.lammps.run(command)

    def test_run_problem(self):
        command = "thisisnotalammpscommmand"
        with self.assertRaises(RuntimeError):
            self.lammps.run(command)

    def test_cannot_find_lammps(self):
        lammps_name = "this_is_not_lammps"
        with self.assertRaises(RuntimeError):
            self.lammps = LammpsProcess(lammps_name=lammps_name)


if __name__ == '__main__':
    unittest.main()

@@ -8,16 +8,46 @@
 unittest
+%0Aimport shutil%0Aimport tempfile
 %0A%0Afrom s
@@ -172,39 +172,171 @@
    self.
-lammps = LammpsProcess(
+temp_dir = tempfile.mkdtemp()%0A        self.lammps = LammpsProcess(log_directory=self.temp_dir)%0A%0A    def tearDown(self):%0A        shutil.rmtree(self.temp_dir
 )%0A%0A    d

update test so that LAMMPS log is written tmp