from casatools import ctsys
from casatestutils.stakeholder import almastktestutils
from casatestutils import compare
class Test_almastkutils(unittest.TestCase):
''' common input data '''
cls.datapath = ctsys.resolve('stakeholder/alma')
cls.oldtestscr = 'test_stk_alma_pipeline_imaging_old.py'
cls.curjson = 'test_stk_alma_pipeline_imaging_exp_dicts.json'
cls.stdcubejson = 'test_standard_cube_cur_stats.json'
cls.updatedjson = 'update_exp_subdicts.json'
shutil.copy(os.path.join(self.datapath,self.stdcubejson),self.stdcubejson)
shutil.copy(os.path.join(self.datapath,self.curjson),self.curjson)
shutil.copy(os.path.join(self.datapath,self.updatedjson), self.updatedjson)
def compareDict(self, indict, refdict):
''' compare metric dictionaries, allow the comparison on vlaues between exp_dicts with extra flags and current metric dicts '''
if isinstance(indict[key],dict):
if isinstance(refdict[key][mt],list) and not isinstance(indict[key][mt],list):
if indict[key][mt] == refdict[key][mt][1]:
if indict[key][mt] == refdict[key][mt]:
if isinstance(refdict[key],list) and not isinstance(indict[key],list):
if indict[key] == refdict[key][1]:
if indict[key]==refdict[key]:
def test_extract_subexpdict(self):
''' Test a fuction to extract a subset of exp dicts from a single testcase json file '''
print("stdcubejon=",self.stdcubejson)
metrickeys=['im_stats_dict','psf_stats_dict']