From d1463d2140e810e1595e48b46428a59923da8094 Mon Sep 17 00:00:00 2001
From: stedif <stefano.difrischia@inaf.it>
Date: Mon, 3 Oct 2022 16:50:08 +0200
Subject: [PATCH] L2SS-984 add subband and clock change test

---
 .../default/devices/test_device_beamlet.py       | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_beamlet.py b/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_beamlet.py
index ff8bcebde..519a24cab 100644
--- a/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_beamlet.py
+++ b/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_beamlet.py
@@ -85,8 +85,7 @@ class TestDeviceBeamlet(AbstractTestBases.TestDeviceBase):
         sdp_proxy = self.setup_sdp()
 
         self.proxy.initialise()
-        # TODO(Corne): Update test so effects of attribute are asserted L2SS-984
-        # self.proxy.subband_select_RW = list(range(488))
+        self.proxy.subband_select_RW = numpy.array(list(range(317)) + [316] + list(range(318,488)), dtype=numpy.uint32)
         self.proxy.on()
 
         # any non-zero delay should result in different weights for different clocks
@@ -108,3 +107,16 @@ class TestDeviceBeamlet(AbstractTestBases.TestDeviceBase):
         self.assertTrue((calculated_bf_weights_200 != calculated_bf_weights_160).all())
         self.assertTrue((calculated_bf_weights_200 == calculated_bf_weights_200_v2).all())
 
+        # change subbands
+        self.proxy.off()
+        self.proxy.initialise()
+        self.proxy.subband_select_RW = [317] * 488
+        self.proxy.on()
+        calculated_bf_weights_200_v3 = self.proxy.calculate_bf_weights(delays.flatten())
+        self.assertTrue((calculated_bf_weights_200_v2 != calculated_bf_weights_200_v3).all())
+
+        sdp_proxy.clock_RW = 160 * 1000000
+        time.sleep(1) # wait for beamlet device to process change event
+        calculated_bf_weights_160_v2 = self.proxy.calculate_bf_weights(delays.flatten())
+        self.assertTrue((calculated_bf_weights_160 != calculated_bf_weights_160_v2).all())
+
-- 
GitLab