-
-
Notifications
You must be signed in to change notification settings - Fork 514
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
functional tests script #1928
base: master
Are you sure you want to change the base?
functional tests script #1928
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good! All comments but the 255 vs 256 are suggestions and me spouting info. If they are non-applicable feel free to ignore and resolve the comments. 😄
for r1, g1, b1, r2, g2, b2 in ((256, 0, 0, 0, 0, 0), (0, 256, 0, 0, 0, 0), (0, 0, 256, 0, 0, 0), | ||
(0, 0, 0, 256, 0, 0), (0, 0, 0, 0, 256, 0), (0, 0, 0, 0, 0, 256)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the 256 values be 255?
import sys | ||
from openrazer.client import DeviceManager | ||
from openrazer.client import constants as razer_constants | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A quick "about" section would be helpful. Things like use cases for this tool and expected invocation.
print() | ||
|
||
|
||
prompt = 'noprompt' not in sys.argv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like to use argparse
to handle passed in parameters. It also helps users understand how to use the tool. This is no a blocker though.
if capability == "name": | ||
print(f"device.name: {device.name}") | ||
elif capability == "type": | ||
print(f"device.type: {device.type}") | ||
elif capability == "firmware_version": | ||
print(f"device.firmware_version: {device.firmware_version}") | ||
elif capability == "serial": | ||
print(f"device.serial: {device.serial}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Putting all of these bit of info into a get_basic_info
function could be helpful for showing information that is expected. I think if any of these are missing then that should be a red flag that something isn't working quite right. One could imaging an output like the following.
Name: Death Adder Gen X
Device Type: Mouse
Firmware Version: MISSING!
Serial Number: MISSING!
Not sure if that sort of info is outside the scope. If so, ignore me. 😄
For running automated tests of the kernel module I've hacked this script together (some capabilities still need to be implemented).
Can you give me some early feedback, might also be good to reference this in #1919 as one of the checks when adding support for a new feature/device.