From 700f819d2130891f776707e96d11914f84928382 Mon Sep 17 00:00:00 2001 From: Jan Kotanski Date: Wed, 5 Feb 2025 23:16:06 +0100 Subject: [PATCH] update tests --- nxsrecconfig/ProfileManager.py | 4 ++-- test/BasicSettings2_test.py | 16 ++++++++-------- test/BasicSettings3_test.py | 16 ++++++++-------- test/BasicSettings_test.py | 19 +++++++++---------- test/ExtraSettings2_test.py | 16 ++++++++-------- test/ExtraSettings3_test.py | 16 ++++++++-------- test/ExtraSettings_test.py | 16 ++++++++-------- test/ProfileManager2_test.py | 28 ++++++++++++++-------------- test/ProfileManager3_test.py | 28 ++++++++++++++-------------- test/ProfileManager_test.py | 28 ++++++++++++++-------------- test/Settings_test.py | 21 ++++++++++++--------- test/Utils_test.py | 2 +- 12 files changed, 106 insertions(+), 104 deletions(-) diff --git a/nxsrecconfig/ProfileManager.py b/nxsrecconfig/ProfileManager.py index 6618972..0cc840f 100644 --- a/nxsrecconfig/ProfileManager.py +++ b/nxsrecconfig/ProfileManager.py @@ -1509,7 +1509,7 @@ def __addChannel(cls, cnf, ctrl, device, fullname, dontdisplay, index, if device in dontdisplay: dct['plot_axes'] = [] dct['plot_type'] = 0 - dct['ndim'] = 0 + dct['ndim'] = len(dct['shape'] or []) elif dct['shape'] and len(dct['shape']) == 1: dct['plot_axes'] = [''] dct['plot_type'] = 1 @@ -1589,7 +1589,7 @@ def __addTangoChannel(cls, cnf, ctrl, device, record, dontdisplay, index): if device in dontdisplay: dct['plot_axes'] = [] dct['plot_type'] = 0 - dct['ndim'] = 0 + dct['ndim'] = len(dct['shape'] or []) elif dct['shape'] and len(dct['shape']) == 1: dct['plot_axes'] = [''] dct['plot_type'] = 1 diff --git a/test/BasicSettings2_test.py b/test/BasicSettings2_test.py index 92e2835..3e0a198 100644 --- a/test/BasicSettings2_test.py +++ b/test/BasicSettings2_test.py @@ -12824,7 +12824,7 @@ def test_updateMntGrp_components_nopool_tango(self): for i, ds in enumerate(chds): cnt = self.smychs[str(ds)] try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -13089,7 +13089,7 @@ def test_updateMntGrp_components_nopool_tango_unplottedcomponents(self): for i, ds in enumerate(chds): cnt = self.smychs[str(ds)] try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -13391,7 +13391,7 @@ def test_updateMntGrp_components_pool_tango(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -13725,7 +13725,7 @@ def test_updateMntGrp_components_pool_tango_unplottedcomponents(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -14075,7 +14075,7 @@ def test_updateMntGrp_components_mixed_tango_unplottedcomponents(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -14115,7 +14115,7 @@ def test_updateMntGrp_components_mixed_tango_unplottedcomponents(self): i = chds.index(str(ds)) # print "INDEX", i, ds try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -14489,7 +14489,7 @@ def test_updateMntGrp_components_mixed_tango_orderedchannels(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -14529,7 +14529,7 @@ def test_updateMntGrp_components_mixed_tango_orderedchannels(self): i = chds.index(str(ds)) # print "INDEX", i, ds try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], diff --git a/test/BasicSettings3_test.py b/test/BasicSettings3_test.py index 08c0d22..6dc4f30 100644 --- a/test/BasicSettings3_test.py +++ b/test/BasicSettings3_test.py @@ -12822,7 +12822,7 @@ def test_updateMntGrp_components_nopool_tango(self): i = 0 cnt = self.smychs[str(ds)] try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -13091,7 +13091,7 @@ def test_updateMntGrp_components_nopool_tango_unplottedcomponents(self): i = 0 cnt = self.smychs[str(ds)] try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -13401,7 +13401,7 @@ def test_updateMntGrp_components_pool_tango(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -13740,7 +13740,7 @@ def test_updateMntGrp_components_pool_tango_unplottedcomponents(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -14095,7 +14095,7 @@ def test_updateMntGrp_components_mixed_tango_unplottedcomponents(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -14140,7 +14140,7 @@ def test_updateMntGrp_components_mixed_tango_unplottedcomponents(self): if i > cri: i = i + 1 try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -14518,7 +14518,7 @@ def test_updateMntGrp_components_mixed_tango_orderedchannels(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -14564,7 +14564,7 @@ def test_updateMntGrp_components_mixed_tango_orderedchannels(self): i = i + 1 # print "INDEX", i, ds try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], diff --git a/test/BasicSettings_test.py b/test/BasicSettings_test.py index 9c0eeef..021fb64 100644 --- a/test/BasicSettings_test.py +++ b/test/BasicSettings_test.py @@ -12822,7 +12822,7 @@ def test_updateMntGrp_components_nopool_tango_masterfirst(self): i = 0 cnt = self.smychs[str(ds)] try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -13054,7 +13054,7 @@ def test_updateMntGrp_components_nopool_tango(self): for i, ds in enumerate(chds): cnt = self.smychs[str(ds)] try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -13323,7 +13323,7 @@ def test_updateMntGrp_components_nopool_tango_unplottedcomponents(self): for i, ds in enumerate(chds): cnt = self.smychs[str(ds)] try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -13629,7 +13629,7 @@ def test_updateMntGrp_components_pool_tango(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -13965,7 +13965,7 @@ def test_updateMntGrp_components_pool_tango_unplottedcomponents(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -14318,7 +14318,7 @@ def test_updateMntGrp_components_mixed_tango_unplottedcomponents(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -14360,7 +14360,7 @@ def test_updateMntGrp_components_mixed_tango_unplottedcomponents(self): i = chds.index(str(ds)) # print "INDEX", i, ds try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -14736,7 +14736,7 @@ def test_updateMntGrp_components_mixed_tango_orderedchannels(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -14778,7 +14778,7 @@ def test_updateMntGrp_components_mixed_tango_orderedchannels(self): i = chds.index(str(ds)) # print "INDEX", i, ds try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -14820,7 +14820,6 @@ def test_updateMntGrp_components_mixed_tango_orderedchannels(self): "description": "Measurement Group", "timer": "%s" % dv, "label": "mg2"} -# print "SMG", smg self.myAssertDict(smg, pcnf) self.myAssertDict(pcnf, cnf) rs.mntGrp = "nxsmntgrp" diff --git a/test/ExtraSettings2_test.py b/test/ExtraSettings2_test.py index 8c60e14..7cea15c 100644 --- a/test/ExtraSettings2_test.py +++ b/test/ExtraSettings2_test.py @@ -459,7 +459,7 @@ def test_updateMntGrp_components_mixed_tango_timers(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -511,7 +511,7 @@ def test_updateMntGrp_components_mixed_tango_timers(self): i = chds.index(str(ds)) # print "INDEX", i, ds try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -969,7 +969,7 @@ def test_updateMntGrp_mntGrpConfiguration_isMntGrpUpdated(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -1020,7 +1020,7 @@ def test_updateMntGrp_mntGrpConfiguration_isMntGrpUpdated(self): i = chds.index(str(ds)) # print "INDEX", i, ds try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -1552,7 +1552,7 @@ def subtest_switchProfile_importMntGrp(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': @@ -1605,7 +1605,7 @@ def subtest_switchProfile_importMntGrp(self): i = chds.index(str(ds)) # print "INDEX", i, ds try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -2964,7 +2964,7 @@ def test_myswitchProfile_importMntGrp(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': @@ -3017,7 +3017,7 @@ def test_myswitchProfile_importMntGrp(self): i = chds.index(str(ds)) # print "INDEX", i, ds try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], diff --git a/test/ExtraSettings3_test.py b/test/ExtraSettings3_test.py index 0a66e6f..a7639f9 100644 --- a/test/ExtraSettings3_test.py +++ b/test/ExtraSettings3_test.py @@ -466,7 +466,7 @@ def test_updateMntGrp_components_mixed_tango_timers(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -524,7 +524,7 @@ def test_updateMntGrp_components_mixed_tango_timers(self): i = i + 1 # print "INDEX", i, ds try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -986,7 +986,7 @@ def test_updateMntGrp_mntGrpConfiguration_isMntGrpUpdated(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -1043,7 +1043,7 @@ def test_updateMntGrp_mntGrpConfiguration_isMntGrpUpdated(self): i = i + 1 # print "INDEX", i, ds try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -1580,7 +1580,7 @@ def subtest_switchProfile_importMntGrp(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': @@ -1638,7 +1638,7 @@ def subtest_switchProfile_importMntGrp(self): if i < cri: i = i + 1 try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -3053,7 +3053,7 @@ def test_myswitchProfile_importMntGrp(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': @@ -3111,7 +3111,7 @@ def test_myswitchProfile_importMntGrp(self): if i < cri: i = i + 1 try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], diff --git a/test/ExtraSettings_test.py b/test/ExtraSettings_test.py index 1aa4e76..b526887 100644 --- a/test/ExtraSettings_test.py +++ b/test/ExtraSettings_test.py @@ -461,7 +461,7 @@ def test_updateMntGrp_components_mixed_tango_timers(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -515,7 +515,7 @@ def test_updateMntGrp_components_mixed_tango_timers(self): i = chds.index(str(ds)) # print "INDEX", i, ds try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -980,7 +980,7 @@ def test_updateMntGrp_mntGrpConfiguration_isMntGrpUpdated(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -1034,7 +1034,7 @@ def test_updateMntGrp_mntGrpConfiguration_isMntGrpUpdated(self): i = chds.index(str(ds)) # print "INDEX", i, ds try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -1571,7 +1571,7 @@ def subtest_switchProfile_importMntGrp(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': @@ -1627,7 +1627,7 @@ def subtest_switchProfile_importMntGrp(self): i = chds.index(str(ds)) # print "INDEX", i, ds try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -2991,7 +2991,7 @@ def test_myswitchProfile_importMntGrp(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': @@ -3047,7 +3047,7 @@ def test_myswitchProfile_importMntGrp(self): i = chds.index(str(ds)) # print "INDEX", i, ds try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], diff --git a/test/ProfileManager2_test.py b/test/ProfileManager2_test.py index ee89368..f6b0a61 100644 --- a/test/ProfileManager2_test.py +++ b/test/ProfileManager2_test.py @@ -3568,7 +3568,7 @@ def test_updateProfile_components_nopool_tango(self): for i, ds in enumerate(chds): cnt = self.smychs[str(ds)] try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -3831,7 +3831,7 @@ def test_updateProfile_components_nopool_tango_unplottedcomponents(self): for i, ds in enumerate(chds): cnt = self.smychs[str(ds)] try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -4133,7 +4133,7 @@ def test_updateProfile_components_pool_tango(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -4462,7 +4462,7 @@ def test_updateProfile_components_pool_tango_unplottedcomponents(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -4808,7 +4808,7 @@ def test_updateProfile_components_mixed_tango_unplottedcomponents(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -4848,7 +4848,7 @@ def test_updateProfile_components_mixed_tango_unplottedcomponents(self): cnt = self.smychs[str(ds)] i = chds.index(str(ds)) try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -5192,7 +5192,7 @@ def test_updateProfile_components_mixed_tango_orderedchannels(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -5231,7 +5231,7 @@ def test_updateProfile_components_mixed_tango_orderedchannels(self): cnt = self.smychs[str(ds)] i = chds.index(str(ds)) try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -5608,7 +5608,7 @@ def test_updateProfile_components_mixed_tango_timers(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -5658,7 +5658,7 @@ def test_updateProfile_components_mixed_tango_timers(self): cnt = self.smychs[str(ds)] i = chds.index(str(ds)) try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -6101,7 +6101,7 @@ def test_updateProfile_mntGrpConfiguration_isMntGrpUpdated(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -6151,7 +6151,7 @@ def test_updateProfile_mntGrpConfiguration_isMntGrpUpdated(self): cnt = self.smychs[str(ds)] i = chds.index(str(ds)) try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -6654,7 +6654,7 @@ def test_switchProfile_importMntGrp(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': @@ -6707,7 +6707,7 @@ def test_switchProfile_importMntGrp(self): i = chds.index(str(ds)) # print "INDEX", i, ds try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], diff --git a/test/ProfileManager3_test.py b/test/ProfileManager3_test.py index 4a83ebd..23d3b1e 100644 --- a/test/ProfileManager3_test.py +++ b/test/ProfileManager3_test.py @@ -3531,7 +3531,7 @@ def test_updateProfile_components_nopool_tango(self): i = 0 cnt = self.smychs[str(ds)] try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -3795,7 +3795,7 @@ def test_updateProfile_components_nopool_tango_unplottedcomponents(self): i = 0 cnt = self.smychs[str(ds)] try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -4101,7 +4101,7 @@ def test_updateProfile_components_pool_tango(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -4432,7 +4432,7 @@ def test_updateProfile_components_pool_tango_unplottedcomponents(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -4780,7 +4780,7 @@ def test_updateProfile_components_mixed_tango_unplottedcomponents(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -4826,7 +4826,7 @@ def test_updateProfile_components_mixed_tango_unplottedcomponents(self): if i > cri: i = i + 1 try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -5172,7 +5172,7 @@ def test_updateProfile_components_mixed_tango_orderedchannels(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -5217,7 +5217,7 @@ def test_updateProfile_components_mixed_tango_orderedchannels(self): if i > cri: i = i + 1 try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -5596,7 +5596,7 @@ def test_updateProfile_components_mixed_tango_timers(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -5652,7 +5652,7 @@ def test_updateProfile_components_mixed_tango_timers(self): if i < cri: i = i + 1 try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -6100,7 +6100,7 @@ def test_updateProfile_mntGrpConfiguration_isMntGrpUpdated(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -6156,7 +6156,7 @@ def test_updateProfile_mntGrpConfiguration_isMntGrpUpdated(self): if i < cri: i = i + 1 try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -6667,7 +6667,7 @@ def test_switchProfile_importMntGrp(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': @@ -6726,7 +6726,7 @@ def test_switchProfile_importMntGrp(self): i = i + 1 # print "INDEX", i, ds try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], diff --git a/test/ProfileManager_test.py b/test/ProfileManager_test.py index 243f328..a135907 100644 --- a/test/ProfileManager_test.py +++ b/test/ProfileManager_test.py @@ -3617,7 +3617,7 @@ def test_updateProfile_components_nopool_tango(self): for i, ds in enumerate(chds): cnt = self.smychs[str(ds)] try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -3887,7 +3887,7 @@ def test_updateProfile_components_nopool_tango_unplottedcomponents(self): for i, ds in enumerate(chds): cnt = self.smychs[str(ds)] try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -4192,7 +4192,7 @@ def test_updateProfile_components_pool_tango(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -4530,7 +4530,7 @@ def test_updateProfile_components_pool_tango_unplottedcomponents(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -4892,7 +4892,7 @@ def test_updateProfile_components_mixed_tango_unplottedcomponents(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -4934,7 +4934,7 @@ def test_updateProfile_components_mixed_tango_unplottedcomponents(self): i = chds.index(str(ds)) # print "INDEX", i, ds try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -5297,7 +5297,7 @@ def test_updateProfile_components_mixed_tango_orderedchannels(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -5339,7 +5339,7 @@ def test_updateProfile_components_mixed_tango_orderedchannels(self): i = chds.index(str(ds)) # print "INDEX", i, ds try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -5731,7 +5731,7 @@ def test_updateProfile_components_mixed_tango_timers(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -5785,7 +5785,7 @@ def test_updateProfile_components_mixed_tango_timers(self): i = chds.index(str(ds)) # print "INDEX", i, ds try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -6248,7 +6248,7 @@ def test_updateProfile_mntGrpConfiguration_isMntGrpUpdated(self): if i < idmax: idmax = i ttdv = tdv - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -6302,7 +6302,7 @@ def test_updateProfile_mntGrpConfiguration_isMntGrpUpdated(self): i = chds.index(str(ds)) # print "INDEX", i, ds try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], @@ -6813,7 +6813,7 @@ def test_switchProfile_importMntGrp(self): idmax = i ttdv = tdv # ttds = ds - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': @@ -6870,7 +6870,7 @@ def test_switchProfile_importMntGrp(self): i = chds.index(str(ds)) # print "INDEX", i, ds try: - chn = {'ndim': 0, + chn = {'ndim': len(cnt['shape']), 'index': i, 'name': str(ds), 'data_type': cnt['data_type'], diff --git a/test/Settings_test.py b/test/Settings_test.py index c77d056..4b45760 100644 --- a/test/Settings_test.py +++ b/test/Settings_test.py @@ -2280,15 +2280,17 @@ def myAssertDict(self, dct, dct2): logger.debug('dict %s' % type(dct)) logger.debug("\n%s\n%s" % (dct, dct2)) self.assertTrue(isinstance(dct, dict)) - # if not isinstance(dct2, dict): - # print "NOT DICT", type(dct2), dct2 - # print "DICT", type(dct), dct + if not isinstance(dct2, dict): + if sys.version_info > (3,): + print("NOT DICT", type(dct2), dct2) + print("DICT", type(dct), dct) self.assertTrue(isinstance(dct2, dict)) logger.debug("%s %s" % (len(dct.keys()), len(dct2.keys()))) - # if set(dct.keys()) ^ set(dct2.keys()): - # print 'DCT', dct.keys() - # print 'DCT2', dct2.keys() - # print "DIFF", set(dct.keys()) ^ set(dct2.keys()) + if set(dct.keys()) ^ set(dct2.keys()): + if sys.version_info > (3,): + print('DCT', dct.keys()) + print('DCT2', dct2.keys()) + print("DIFF", set(dct.keys()) ^ set(dct2.keys())) self.assertEqual(len(dct.keys()), len(dct2.keys())) for k, v in dct.items(): logger.debug("%s in %s" % (str(k), str(dct2.keys()))) @@ -2297,8 +2299,9 @@ def myAssertDict(self, dct, dct2): self.myAssertDict(v, dct2[k]) else: logger.debug("%s , %s" % (str(v), str(dct2[k]))) - # if v != dct2[k]: - # print 'VALUES', k, v, dct2[k] + if v != dct2[k]: + if sys.version_info > (3,): + print('VALUES', k, v, dct2[k]) self.assertEqual(v, dct2[k]) def myCompDict(self, dct, dct2): diff --git a/test/Utils_test.py b/test/Utils_test.py index 5648aaf..a05649b 100644 --- a/test/Utils_test.py +++ b/test/Utils_test.py @@ -180,7 +180,7 @@ def __init__(self, methodName): self.cnt = '{"units": {"0":{"channels":{},' \ + ' "trigger_type":0, "id":0, "timer":"%s", "monitor":"%s"}}}' - self.chnl = '{"ndim":0, "index":%s, "name":"%s", "data_type":"%s", ' \ + self.chnl = '{"ndim":%s, "index":%s, "name":"%s", "data_type":"%s", ' \ '"plot_type":%s, "enabled": true, "label": "%s", ' \ '"instrument":null, "shape": [%s], "_controller_name": "%s", ' \ '"conditioning": "", "full_name": "%s", "_unit_id": "0", ' \