Commits

Sandra M Castro authored 78cbbf8be67
Replaced lociteritems function with dict.items()
No tags

casatasks/tests/tasks/test_task_split.py

Modified
39 39 import shutil
40 40 import filecmp
41 41 import unittest
42 42
43 43 from casatasks import cvel, flagcmd, flagdata, importasdm, listobs, partition, split
44 44 from casatools import ctsys, ms, msmetadata, table
45 45 from casatasks.private.parallel.parallel_task_helper import ParallelTaskHelper
46 46
47 47 from casatestutils import testhelper as th
48 48
49 -
50 -def lociteritems(adict):
51 - return adict.items()
52 -
53 49 datapath = ctsys.resolve('unittest/split/')
54 50
55 51 # To run test_split with MMS, create MMS from the MSs used in these tests and save them
56 52 # to a directory in your system that is called unittest/split/. The ctsys.resolve() used
57 53 # in these tests will find the MMS there. Check the --rcdir option of casa to point to
58 54 # a local config.py for this.
59 55
60 56 '''
61 57 Start of old tests, which are the same as test_split.
62 58 class SplitFlags on are new tests.
123 119 Raises a ValueError if the contents of tabname are not the same as those
124 120 of exptabname to within tol.
125 121 """
126 122 exptabdict = slurp_table(exptabname)
127 123 tabdict = slurp_table(tabname)
128 124
129 125 if set(tabdict['keywords']) != set(exptabdict['keywords']):
130 126 raise ValueError(tabname + ' and ' + exptabname + ' have different keywords')
131 127 if set(tabdict['cols'].keys()) != set(exptabdict['cols'].keys()):
132 128 raise ValueError(tabname + ' and ' + exptabname + ' have different columns')
133 - for col, tabentry in lociteritems(tabdict['cols']):
129 + for col, tabentry in tabdict['cols'].items():
134 130 if set(tabentry['keywords']) != set(exptabdict['cols'][col]['keywords']):
135 131 raise ValueError(tabname + ' and ' + exptabname + ' have different keywords for column ' + col)
136 132
137 133 # Check everything in the description except the data manager.
138 134 for thingy in tabentry['desc']:
139 135 if (
140 136 thingy not in ('dataManagerGroup', 'dataManagerType')
141 137 and tabentry['desc'][thingy]
142 138 != exptabdict['cols'][col]['desc'][thingy]
143 139 ):

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut