Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Harness librarisation #42

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Harness librarisation #42

wants to merge 2 commits into from

Conversation

pholat
Copy link
Contributor

@pholat pholat commented May 31, 2022

Instead of loading the harness submodule, it makes much more sense to install it via pip.

[I] ⋊> ~/w/mudita python3                                                                                                                                                                                                                              12:05:26
Python 3.10.4 (main, Mar 23 2022, 23:05:40) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from harness import Harness
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'Harness' from 'harness' (/home/pholat/.local/lib/python3.10/site-packages/harness/__init__.py)
>>> from harness.harness import Harness
>>> harness = Harness.from_detect()
2022/05/31 12:06:05 INFO   CDCSerial:CDCSerial.py:54 opened port /dev/ttyACM1!
>>> @harness.with_phone_unlocked
... def done(connection):
...     pass
... 
2022/05/31 12:06:29 INFO   harness :harness.py:91 Phone unlocked
>>> connection.send_key_code(key_codes["enter"])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'connection' is not defined
>>> harness.connection.send_key_code(key_codes["enter"])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'key_codes' is not defined
>>> harness.connection.send_key_code(key_codes["enter"])
KeyboardInterrupt
>>> from harness.interface.defs import key_codes 
>>> harness.connection.send_key_code(key_codes["enter"])
{'endpoint': 11, 'status': 406, 'uuid': 41}

@pholat pholat requested a review from a team as a code owner May 31, 2022 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants