Skip to content
This repository has been archived by the owner on Apr 23, 2021. It is now read-only.

Commit

Permalink
Merge pull request #12 from simphony/test-tempdir
Browse files Browse the repository at this point in the history
Tempdir for testing
  • Loading branch information
kemattil committed Mar 23, 2015
2 parents 2dfa787 + c4dd937 commit 75499f9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions jyulb/fileio/isothermal3D/tests/test_jyu_engine.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
"""Testing module for a file-io based wrapper for JYU-LB modeling engine."""
import math
import os
import tempfile
import shutil
import unittest
from simphony.core.cuba import CUBA
from simphony.cuds.lattice import make_cubic_lattice
Expand Down Expand Up @@ -32,6 +35,15 @@ def setUp(self):
self.channel_h = 0.5*(self.nx-2.0)
self.max_vel = 0.5*self.gz*self.channel_h*self.channel_h/self.kvisc

self.temp_dir = tempfile.mkdtemp()
self.saved_path = os.getcwd()
os.chdir(self.temp_dir)
self.addCleanup(self.cleanup)

def cleanup(self):
os.chdir(self.saved_path)
shutil.rmtree(self.temp_dir)

def test_run_engine(self):
"""Running the jyu-lb modeling engine."""
engine = JYUEngine()
Expand Down

0 comments on commit 75499f9

Please sign in to comment.