Skip to content

Commit

Permalink
test iseg devices
Browse files Browse the repository at this point in the history
  • Loading branch information
lobis committed Jul 3, 2023
1 parent be22e94 commit a6ca02c
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion tests/test_iseg_devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,22 @@
import pytest


def test_iseg_module():
def test_iseg_init(caplog):
caplog.set_level("DEBUG")

Iseg(connect=False)

assert caplog.text == ""

iseg = Iseg(connect=False, logging_level="DEBUG")

assert iseg.baudrate == 115200
assert "Using baud rate 115200" in caplog.text
assert "Using port " in caplog.text
assert "Using timeout " in caplog.text


def test_iseg_module(caplog):
iseg = Iseg(connect=False)

# for ISEG only one module exists
Expand All @@ -15,3 +30,17 @@ def test_iseg_module():

with pytest.raises(Exception):
iseg.module(1)


def test_iseg_channel(caplog):
caplog.set_level("DEBUG")

iseg = Iseg(connect=False, logging_level="DEBUG")

module = iseg.module()

channel = module.channel(0)

assert "Creating channel 0" in caplog.text

print(f"channel: {channel.channel}")

0 comments on commit a6ca02c

Please sign in to comment.