From edc48dc7e46bb4c63d738f8552a1e94d65e324b6 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Wed, 3 Apr 2024 13:19:41 +0100 Subject: [PATCH 1/4] move test to SpinnMachine --- unittests/data/test_data.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/unittests/data/test_data.py b/unittests/data/test_data.py index 14abf3589..4e18e06b1 100644 --- a/unittests/data/test_data.py +++ b/unittests/data/test_data.py @@ -33,13 +33,6 @@ def test_setup(self): with self.assertRaises(DataNotYetAvialable): SpiNNManDataView.get_transceiver() - def test_mock(self): - SpiNNManDataWriter.mock() - set_config("Machine", "version", 5) - # check there is a - # value not what it is - SpiNNManDataView.get_machine() - def test_transceiver(self): writer = SpiNNManDataWriter.setup() with self.assertRaises(DataNotYetAvialable): From a581aaf876c5506c013fbe12aea51238289e0aa7 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Wed, 3 Apr 2024 13:33:08 +0100 Subject: [PATCH 2/4] flake8 --- unittests/data/test_data.py | 1 - 1 file changed, 1 deletion(-) diff --git a/unittests/data/test_data.py b/unittests/data/test_data.py index 4e18e06b1..d537c38c6 100644 --- a/unittests/data/test_data.py +++ b/unittests/data/test_data.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -from spinn_utilities.config_holder import set_config from spinn_utilities.exceptions import (DataNotYetAvialable) from spinnman.config_setup import unittest_setup from spinnman.data import SpiNNManDataView From 2a1816ff4de712af4cccfecc3ac40b7c34c405b2 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Wed, 10 Apr 2024 09:49:34 +0100 Subject: [PATCH 3/4] test with ANY_VERSION --- unittests/model_tests/test_abstract_process.py | 3 ++- unittests/test_transceiver.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/unittests/model_tests/test_abstract_process.py b/unittests/model_tests/test_abstract_process.py index baa7a0d25..b89d12395 100644 --- a/unittests/model_tests/test_abstract_process.py +++ b/unittests/model_tests/test_abstract_process.py @@ -13,6 +13,7 @@ # limitations under the License. from spinn_utilities.config_holder import set_config +from spinn_machine.version import ANY_VERSION from spinnman.processes.abstract_multi_connection_process import ( AbstractMultiConnectionProcess) from spinnman.messages.scp.impl import ReadMemory @@ -40,7 +41,7 @@ def receive_scp_response(self, timeout=1.0): def test_error_print(): unittest_setup() - set_config("Machine", "version", 5) + set_config("Machine", "version", ANY_VERSION) connection = MockConnection(0, 0) process = MockProcess(RoundRobinConnectionSelector([connection])) with pytest.raises(SpinnmanGenericProcessException): diff --git a/unittests/test_transceiver.py b/unittests/test_transceiver.py index d0584a830..77da6f499 100644 --- a/unittests/test_transceiver.py +++ b/unittests/test_transceiver.py @@ -15,6 +15,7 @@ import unittest import struct from spinn_utilities.config_holder import set_config +from spinn_machine.version import ANY_VERSION from spinnman.config_setup import unittest_setup from spinnman.data import SpiNNManDataView from spinnman.data.spinnman_data_writer import SpiNNManDataWriter @@ -83,7 +84,7 @@ def test_boot_board(self): trans._boot_board() def test_set_watch_dog(self): - set_config("Machine", "version", 5) + set_config("Machine", "version", ANY_VERSION) connections = [] connections.append(SCAMPConnection(remote_host=None)) tx = MockExtendedTransceiver() From c1c3ca2920de43b87003d006ea9e586295d64894 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Fri, 12 Apr 2024 15:27:26 +0100 Subject: [PATCH 4/4] VersionStrings as simple Enum --- unittests/model_tests/test_abstract_process.py | 4 ++-- unittests/test_transceiver.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/unittests/model_tests/test_abstract_process.py b/unittests/model_tests/test_abstract_process.py index b89d12395..4dc195e3b 100644 --- a/unittests/model_tests/test_abstract_process.py +++ b/unittests/model_tests/test_abstract_process.py @@ -13,7 +13,7 @@ # limitations under the License. from spinn_utilities.config_holder import set_config -from spinn_machine.version import ANY_VERSION +from spinn_machine.version.version_strings import VersionStrings from spinnman.processes.abstract_multi_connection_process import ( AbstractMultiConnectionProcess) from spinnman.messages.scp.impl import ReadMemory @@ -41,7 +41,7 @@ def receive_scp_response(self, timeout=1.0): def test_error_print(): unittest_setup() - set_config("Machine", "version", ANY_VERSION) + set_config("Machine", "versions", VersionStrings.ANY.text) connection = MockConnection(0, 0) process = MockProcess(RoundRobinConnectionSelector([connection])) with pytest.raises(SpinnmanGenericProcessException): diff --git a/unittests/test_transceiver.py b/unittests/test_transceiver.py index 77da6f499..e454d2963 100644 --- a/unittests/test_transceiver.py +++ b/unittests/test_transceiver.py @@ -15,7 +15,7 @@ import unittest import struct from spinn_utilities.config_holder import set_config -from spinn_machine.version import ANY_VERSION +from spinn_machine.version.version_strings import VersionStrings from spinnman.config_setup import unittest_setup from spinnman.data import SpiNNManDataView from spinnman.data.spinnman_data_writer import SpiNNManDataWriter @@ -84,7 +84,7 @@ def test_boot_board(self): trans._boot_board() def test_set_watch_dog(self): - set_config("Machine", "version", ANY_VERSION) + set_config("Machine", "versions", VersionStrings.ANY.text) connections = [] connections.append(SCAMPConnection(remote_host=None)) tx = MockExtendedTransceiver()