Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ doc = [
]
lint = [
"pyright==1.1.410",
"ruff==0.15.16",
"ruff==0.15.17",
]
test = [
"lewis",
Expand Down
14 changes: 8 additions & 6 deletions tests/test_against_emulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
configure_logging(level=LogLevel.TRACE)


@pytest.fixture(autouse=True, scope="class")
@pytest.fixture(scope="class")
def emulator():
proc = subprocess.Popen(
[
Expand Down Expand Up @@ -84,7 +84,7 @@ async def controller():


class TestInitialState:
def test_sub_controllers_created(self, controller):
def test_sub_controllers_created(self, controller, emulator):
assert "one_of_everything" in controller.sub_controllers

@pytest.mark.parametrize(
Expand All @@ -98,14 +98,14 @@ def test_sub_controllers_created(self, controller):
],
)
async def test_attributes_created_for_simple_datatype(
self, controller, param, expected_initial_value
self, controller, emulator, param, expected_initial_value
):
attr: AttrR = typing.cast(
AttrR, controller.sub_controllers["one_of_everything"].attributes[param]
)
await attr.wait_for_value(expected_initial_value, timeout=2)

async def test_attributes_created_for_enum_datatype(self, controller):
async def test_attributes_created_for_enum_datatype(self, controller, emulator):
attr: AttrR = typing.cast(
AttrR, controller.sub_controllers["one_of_everything"].attributes["enum"]
)
Expand Down Expand Up @@ -147,7 +147,7 @@ async def test_attributes_created_for_enum_datatype(self, controller):
],
)
async def test_attributes_created_for_array_datatype(
self, controller, param, expected_initial_value
self, controller, emulator, param, expected_initial_value
):
attr: AttrR = typing.cast(
AttrR, controller.sub_controllers["one_of_everything"].attributes[param]
Expand All @@ -165,6 +165,8 @@ async def test_attributes_created_for_array_datatype(
("command_null_null", set()),
],
)
async def test_command_attributes_created(self, controller, command, expected_attributes):
async def test_command_attributes_created(
self, controller, emulator, command, expected_attributes
):
cmd_controller = controller.sub_controllers["one_of_everything"].sub_controllers[command]
assert set(cmd_controller.attributes.keys()) == expected_attributes