Skip to content

Commit

Permalink
test version error
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed Jun 3, 2024
1 parent 4f24e61 commit e126165
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion unittests/data/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)

0 comments on commit e126165

Please sign in to comment.