Add unit tests for user scripts module#628
Conversation
|
If you can't pick other input types and one should be able to, then yeah, that's definitely not intended. Though one can define what kind of inputs should be allowed, I'll have to look at how complete/buggy that is. You may definitely run into bugs with the user scripts part as that's not been heavily tested and refactored quite heavily. So if you see something that's weird just let me know. The logical devices will definitely be part of the user scripts part as well but obviously right now aren't there yet. I should put that on the list of things to add. |
| # Data below was generated from a vJoy device. | ||
| guid = dill._GUID( | ||
| def get_fake_device_guid(is_virtual: bool) -> uuid.UUID: | ||
| return dill._GUID( |
There was a problem hiding this comment.
Beware that while both dill.GUID and uuid.UUID are the same thing (as far as the values they can hold internally), their types aren't interchangeable, and it can cause tricky bugs if they're mixed. I try hard to have only uuid.UUID inside of Gremlin with dill.GUID propagating no further than the events Gremlin receives from the dill library. Though there are likely still places where dill.GUID are floating around.
There was a problem hiding this comment.
Good catch! The type hint was wrong, fixed.
…input type (axis, button, hat)
3caf2f3 to
ec5533a
Compare
Ah, this was key. So it's user error in my part, I forgot that in my script I had specified it to be specifically an axis. Okay, added coverage for the input variables for each type. Let me know if any more changes are needed. |
|
Looks good to me 👍 |
One thing I noticed is that the virtual input variable seems to be incomplete - in the GUI you can only pick axes, not buttons or hats?
For the next couple of pull requests the plan is to add: