From e126165d58a73e210c96cdbeb34d7614c8a5fc15 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Mon, 3 Jun 2024 09:48:48 +0100 Subject: [PATCH] test version error --- unittests/data/test_data.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/unittests/data/test_data.py b/unittests/data/test_data.py index 6a65e38b..bf0753d1 100644 --- a/unittests/data/test_data.py +++ b/unittests/data/test_data.py @@ -14,11 +14,12 @@ import unittest from spinn_utilities.config_holder import set_config -from spinn_utilities.exceptions import (DataNotYetAvialable) +from spinn_utilities.exceptions import (ConfigException, DataNotYetAvialable) from spinn_machine import virtual_machine from spinn_machine.config_setup import unittest_setup from spinn_machine.data import MachineDataView from spinn_machine.data.machine_data_writer import MachineDataWriter +from spinn_machine.exceptions import SpinnMachineException from spinn_machine.version import FIVE, THREE, SPIN2_48CHIP from spinn_machine.version.version_strings import VersionStrings @@ -185,3 +186,12 @@ def test_get_monitors(self): writer.add_monitor_core(True) self.assertEqual(2, MachineDataView.get_all_monitor_cores()) self.assertEqual(3, MachineDataView.get_ethernet_monitor_cores()) + + def test_no_version(self): + set_config("Machine", "machineName", "SpiNNaker1M") + try: + MachineDataView.get_machine_version() + raise ConfigException("Should not get here") + except SpinnMachineException as ex: + msg = str(ex) + self.assertIn("SpiNNaker1M", msg)