You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 1, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Jun 1, 2026. It is now read-only.
Add simple test type that allows you to specify when buttons are pressed #8
This is the most common type of simplistic test one might want, I imagine. The primary usefulness I think would be exercising all your stuff, so you can be sure that they don't have syntax errors. Adding an additional function that gets called to check it is nice, but should be optional. Something like.. hm. I don't really know what this looks like. Maybe:
# port, button number?
release = (1, 1)
fire = (1,2)
# time, button to press (defaults to pressing for 0.2s)
tests = [
(1.0, release),
(2.0, fire),
..
]
run_button_test(tests)
Activity
sarosenb commentedon Dec 17, 2014
I can see the usefulness of this. What is the 1.0 and 2.0 in the test list used for?
virtuald commentedon Dec 17, 2014
That would be the time to activate the button.
sarosenb commentedon Dec 17, 2014
I think what you can do is, if you want to assert something at the end of a
test you could have something like this:
port, button number?
release = (1, 1)
fire = (1,2)
time, button to press (defaults to pressing for 0.2s),
(optional)lamda to be run at end #of test
tests = [
(1.0, release, lamda:assert(hal_data['pwm'][0]['val'] = 1),
(2.0, fire),
..
]
On Wed, Dec 17, 2014 at 11:19 AM, Dustin Spicuzza notifications@github.com
wrote:
virtuald commentedon Dec 17, 2014
yeah, the lambda thing was what I was thinking too.