Skip to content

Commit d28a886

Browse files
authored
fix(tests, utils): fix regressions (#736)
* recording.monitor_hefith -> recording.monitor_height * add test_utils.py * release-and-publish.yml: poetry run postinstall * black
1 parent 588494c commit d28a886

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

.github/workflows/release-and-publish.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
pip install poetry
4343
poetry install
4444
brew install nvm
45-
poetry run install-dashboard
45+
poetry run postinstall
4646
brew install [email protected]
4747
- name: Build executables
4848
run: |
@@ -81,6 +81,7 @@ jobs:
8181
cd openadapt/app/dashboard
8282
npm install
8383
cd ../../../
84+
poetry run postinstall
8485
- name: Build executables
8586
run: |
8687
poetry run python -m openadapt.build

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ cd OpenAdapt
9898
pip3 install poetry
9999
poetry install
100100
poetry shell
101-
poetry run install-dashboard
102101
poetry run postinstall
103102
cd openadapt && alembic upgrade head && cd ..
104103
pytest

openadapt/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ def get_scale_ratios(
293293
if action_event:
294294
recording = action_event.recording
295295
monitor_width = recording.monitor_width
296-
monitor_height = recording.monitor_hefith
296+
monitor_height = recording.monitor_height
297297
image = action_event.screenshot.image
298298
else:
299299
image = take_screenshot()

tests/openadapt/test_utils.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""Test openadapt.utils."""
2+
3+
from openadapt import utils
4+
5+
6+
def test_get_scale_ratios() -> None:
7+
"""Tests utils.get_scale_ratios."""
8+
# TODO: pass in action event
9+
width, height = utils.get_scale_ratios()
10+
11+
assert isinstance(
12+
width, (int, float)
13+
), f"Expected width to be int or float, got {type(width).__name__}"
14+
assert isinstance(
15+
height, (int, float)
16+
), f"Expected height to be int or float, got {type(height).__name__}"

0 commit comments

Comments
 (0)