Changeset 2797
- Timestamp:
- 03/18/13 11:26:14 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/test_scantable.py
r2791 r2797 4 4 import datetime 5 5 from nose.tools import * 6 import asap 6 7 from asap import scantable, selector, mask_not 7 8 from asap.logging import asaplog … … 9 10 asaplog.disable() 10 11 12 def test_version(): 13 assert_equal(asap.__version__, "4.1.2") 14 11 15 def tempdir_setup(): 12 16 os.makedirs("test_temp") … … 17 21 class TestScantable(object): 18 22 def setup(self): 19 s = scantable("data/MOPS.rpf", average=True) 23 pth = os.path.dirname(__file__) 24 s = scantable(os.path.join(pth, "data", "MOPS.rpf"), average=True) 20 25 sel = selector() 21 26 # make sure this order is always correct - in can be random … … 27 32 28 33 def test_init(self): 29 st = scantable("data/MOPS.rpf", average=False) 34 fname = os.path.join(os.path.dirname(__file__), "data", "MOPS.rpf") 35 st = scantable(fname, average=False) 30 36 assert_equal(st.ncycle(), 32) 31 st = scantable( "data/MOPS.rpf", average=True)37 st = scantable(fname, average=True) 32 38 assert_equal(st.ncycle(), 2) 33 st = scantable( "data/MOPS.rpf", unit="Jy")39 st = scantable(fname, unit="Jy") 34 40 assert_equal(st.get_fluxunit(), "Jy") 35 st = scantable( "data/MOPS.rpf", unit="K")41 st = scantable(fname, unit="K") 36 42 assert_equal(st.get_fluxunit(), "K") 37 assert_raises(RuntimeError, scantable, "data/MOPS.rpf", unit="junk")38 st = scantable([ "data/MOPS.rpf","data/MOPS.rpf"], average=False)43 assert_raises(RuntimeError, scantable, fname, unit="junk") 44 st = scantable([fname,fname], average=False) 39 45 assert_equal(st.nscan(), 4) 40 46
Note:
See TracChangeset
for help on using the changeset viewer.