Source
"antenna='DV01&&*' timerange='2013/11/15/10:25:30.516~2013/11/15/10:25:32.454' reason='ACS_not in place'"
import shutil
import unittest
import os
import shutil
import filecmp
import pprint
import exceptions
import flaghelper as fh
from taskinit import qa
from OrderedDictionary import OrderedDict
#
# Test of flaghelper.py
#
'''
Test the following functions:
readFile
readFiles
readAndParse
parseDictionary
applyTimeBuffer
writeFlagCommands
parseAgents
'''
def test_eq(result, total, flagged):
print "%s of %s data was flagged, expected %s of %s" % \
(result['flagged'], result['total'], flagged, total)
assert result['total'] == total, \
"%s data in total; %s expected" % (result['total'], total)
assert result['flagged'] == flagged, \
"%s flags set; %s expected" % (result['flagged'], flagged)
def create_input(str_text, filename):
'''Save the string in a text file'''
inp = filename
cmd = str_text
# remove file first
if os.path.exists(inp):
os.system('rm -f '+ inp)
# save to a file
with open(inp, 'w') as f:
f.write(cmd)
f.close()
return
# Path for data
datapath = os.environ.get('CASAPATH').split()[0] + "/casatestdata/unittest/flagdata/"
# Base class which defines setUp functions
# for importing different data sets
class test_base(unittest.TestCase):
def setUp_alma_ms(self):
'''ALMA MS, scan=1,8,10 spw=0~3 4,128,128,1 chans, I,XX,YY'''
self.vis = "uid___A002_X30a93d_X43e_small.ms"