Skip to content
Snippets Groups Projects
Commit 0ffc8816 authored by Martin Teichmann's avatar Martin Teichmann
Browse files

fix tests

parent e78909ae
No related branches found
No related tags found
No related merge requests found
Pipeline #131583 failed
......@@ -25,7 +25,7 @@ from unittest import TestCase, main, skip
from .devices import AnalogInput, AnalogOutput, Motor
from .terminals import EL4104, EL3164, EK1814, Skip
from .ethercat import ECCmd, Terminal
from .ethercat import ECCmd, MachineState, Terminal
from .ebpfcat import (
FastSyncGroup, SyncGroup, TerminalVar, Device, EBPFTerminal, PacketDesc,
SterilePacket)
......@@ -82,11 +82,14 @@ class MockTerminal(Terminal):
await self.apply_eeprom()
async def to_operational(self, state=8):
async def to_operational(self, state=MachineState.OPERATIONAL):
assert isinstance(state, MachineState)
before = self.operational
self.operational = state
return state, 0, before
async def sdo_read(self, index, subindex=None):
assert self.operational >= 2
assert self.operational.value >= 2
if subindex is None:
r = b''
for i in count(1):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment