diff --git a/tangostationcontrol/tangostationcontrol/test/clients/test_attr_wrapper.py b/tangostationcontrol/tangostationcontrol/test/clients/test_attr_wrapper.py index 13312bd86acc15867595da4523a14f6d6c092ea4..3df327161d26de6f681d75f20eb3371b7dc6f9f1 100644 --- a/tangostationcontrol/tangostationcontrol/test/clients/test_attr_wrapper.py +++ b/tangostationcontrol/tangostationcontrol/test/clients/test_attr_wrapper.py @@ -367,48 +367,7 @@ class TestAttributeTypes(base.TestCase): # reading back happens in readback_test print(" Test passed! Managed to write: ".format(val)) - - def read_RW_test(self, dev, dtype, test_type): - '''Test device''' - expected = None - val = None - - try: - with DeviceTestContext(dev, process=True) as proxy: - - #initialise - proxy.initialise() - proxy.on() - - if test_type == "scalar": - expected = numpy.zeros((1,), dtype=dtype) - val = proxy.scalar_RW - elif test_type == "spectrum": - expected = numpy.zeros(spectrum_dims, dtype=dtype) - val = proxy.spectrum_RW - elif test_type == "image": - expected = numpy.zeros(image_dims, dtype=dtype) - val = numpy.array(proxy.image_RW) #is needed for STR since they act differently - - # cant use all() for 2d arrays so instead compare the dimensions and then flatten to 2d - self.assertEqual(val.shape, expected.shape, " image R array dimensions got mangled. Expected {}, got {}".format(expected.shape, val.shape)) - val.reshape(-1) - else: - self.assertEqual(1,2, " {} is not a valid test_type. please use either scalar, spectrum or image".format(test_type)) - - if test_type != "scalar": - # spectrums and the now flattened images can be compared with .all() - comparison = expected == val - equal_arrays = comparison.all() - self.assertTrue(equal_arrays, " Value could not be handled by the atrribute_wrappers internal RW storer") - else: - comparison = expected == val - self.assertTrue(comparison, " Value could not be handled by the atrribute_wrappers internal RW storer") - - print(" Test passed! Managed to read internal RW value. got: {}".format(val)) - except Exception as e: - info = "Test failure in {} {} read RW test. Expected: {}, got {}".format(test_type, dtype, expected, val) - raise Exception(info) from e + def readback_test(self, dev, dtype, test_type): '''Test device'''