From 87589844ea18f8e14db1e65ff3aad831f449b0f0 Mon Sep 17 00:00:00 2001
From: thijs snijder <snijder@astron.nl>
Date: Thu, 2 Dec 2021 12:09:24 +0100
Subject: [PATCH] removed read_RW_test unit test function, as the RW now use
 the same code as the read only points

---
 .../test/clients/test_attr_wrapper.py         | 43 +------------------
 1 file changed, 1 insertion(+), 42 deletions(-)

diff --git a/tangostationcontrol/tangostationcontrol/test/clients/test_attr_wrapper.py b/tangostationcontrol/tangostationcontrol/test/clients/test_attr_wrapper.py
index 13312bd86..3df327161 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'''
-- 
GitLab