Commit b2aeca28 authored by Zhang Xin's avatar Zhang Xin
Browse files

modify unit test data folder name by Bo's request

parent 7bd207f0
#
#need add environment parameter TEST_HOME, link to "testData/"
#need add environment parameter UNIT_TEST_DATA_ROOT, link to "testData/"
#linx and mac can run as follow, need modify the name of file directory
#export TEST_HOME=/Users/zhangxin/Work/SlitlessSim/CSST_SIM/CSST_develop/csst-simulation/tests/testData
#export UNIT_TEST_DATA_ROOT=/Users/zhangxin/Work/SlitlessSim/CSST_SIM/CSST_develop/csst-simulation/tests/testData
#
import unittest
from ObservationSim.MockObject.SpecDisperser import rotate90, SpecDisperser
......@@ -145,9 +145,9 @@ class TestSpecDisperse(unittest.TestCase):
def __init__(self, methodName='runTest'):
super(TestSpecDisperse,self).__init__(methodName)
self.conff= os.path.join(os.getenv('TEST_HOME'), 'CSST_GI2.conf')
self.throughputf= os.path.join(os.getenv('TEST_HOME'), 'GI.Throughput.1st.fits')
self.testDir = os.getenv('TEST_HOME')
self.conff= os.path.join(os.getenv('UNIT_TEST_DATA_ROOT'), 'CSST_GI2.conf')
self.throughputf= os.path.join(os.getenv('UNIT_TEST_DATA_ROOT'), 'GI.Throughput.1st.fits')
self.testDir = os.getenv('UNIT_TEST_DATA_ROOT')
# self.conff = conff
# self.throughputf = throughputf
......@@ -697,8 +697,8 @@ class TestSpecDisperse(unittest.TestCase):
if __name__ == '__main__':
os.environ['TEST_HOME']="/Users/zhangxin/Work/SlitlessSim/CSST_SIM/CSST_develop/csst-simulation/tests/testData"
testDir = os.getenv('TEST_HOME')
os.environ['UNIT_TEST_DATA_ROOT']="/Users/zhangxin/Work/SlitlessSim/CSST_SIM/CSST_develop/csst-simulation/tests/testData"
testDir = os.getenv('UNIT_TEST_DATA_ROOT')
# conff= os.path.join(testDir, 'CSST_GI2.conf')
# throughputf= os.path.join(testDir, 'GI.Throughput.1st.fits')
suit = unittest.TestSuite()
......
#
#need add environment parameter TEST_HOME, link to "testData/"
#need add environment parameter UNIT_TEST_DATA_ROOT, link to "testData/"
#linx and mac can run as follow, need modify the name of file directory
#export TEST_HOME=/Users/zhangxin/Work/SlitlessSim/CSST_SIM/CSST_develop/csst-simulation/tests/testData
#export UNIT_TEST_DATA_ROOT=/Users/zhangxin/Work/SlitlessSim/CSST_SIM/CSST_develop/csst-simulation/tests/testData
#
import unittest
from ObservationSim.Straylight import Straylight
......@@ -71,7 +71,7 @@ class TestStraylight(unittest.TestCase):
def __init__(self, methodName='runTest', filter = 'i', grating = "GI"):
super(TestStraylight,self).__init__(methodName)
self.pointingData = np.loadtxt(os.path.join(os.getenv('TEST_HOME'), 'Straylight_test.dat'), dtype=np.double)
self.pointingData = np.loadtxt(os.path.join(os.getenv('UNIT_TEST_DATA_ROOT'), 'Straylight_test.dat'), dtype=np.double)
self.filter = filter
self.grating = grating
......@@ -184,7 +184,7 @@ class TestStraylight(unittest.TestCase):
if __name__ == '__main__':
os.environ['TEST_HOME']="/Users/zhangxin/Work/SlitlessSim/CSST_SIM/CSST_develop/csst-simulation/tests/testData"
os.environ['UNIT_TEST_DATA_ROOT']="/Users/zhangxin/Work/SlitlessSim/CSST_SIM/CSST_develop/csst-simulation/tests/testData"
suit = unittest.TestSuite()
case1 = TestStraylight('test_EarthShineFilter', filter = 'i')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment