Add failing unit test for sangaboard version before v1
This commit is contained in:
parent
70e052fa21
commit
797dda3514
2 changed files with 21 additions and 1 deletions
20
tests/test_sangaboard.py
Normal file
20
tests/test_sangaboard.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
"""Tests for the Sangaboard thing."""
|
||||
|
||||
import pytest
|
||||
|
||||
from openflexure_microscope_server.things.stage.sangaboard import SangaboardThing
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_sanga_thing(mocker):
|
||||
"""Return a Sangaboard thing with a MagicMock for self._sangaboard."""
|
||||
sanga_thing = SangaboardThing()
|
||||
sanga_thing._sangaboard = mocker.MagicMock()
|
||||
return sanga_thing
|
||||
|
||||
|
||||
def test_check_old_firmware(mock_sanga_thing):
|
||||
"""Check firmware prior to version 1 throws a Runtime Error."""
|
||||
mock_sanga_thing._sangaboard.firmware_version.return_value = "0.1.1"
|
||||
with pytest.raises(RuntimeError):
|
||||
mock_sanga_thing.check_firmware()
|
||||
Loading…
Add table
Add a link
Reference in a new issue