-
Notifications
You must be signed in to change notification settings - Fork 17
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
If the disk does not support hdparm -C, use unknown state #46
Conversation
`hdparm -C` on WD SSD Black SN750 M.2 does not return no output
I have a WD_BLACK SN850 that outputs for
What is the exact output you get? |
…converted to DriveState.UNKNOWN
On Debian Buster with kernel 4, |
@@ -194,9 +194,8 @@ def test_getState(self): | |||
universal_newlines=True, | |||
) | |||
with unittest.mock.patch("hddfancontrol.subprocess.check_output") as subprocess_check_output_mock: | |||
subprocess_check_output_mock.side_effect = subprocess.CalledProcessError(0, "") |
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.
This side effect should be kept, we are testing that a hdparm error leads to an hddfancontrol.Drive.DriveState.UNKNOWN
state.
I suggest (untested):
subprocess_check_output_mock.side_effect = subprocess.CalledProcessError(0, "")
self.assertEqual(self.drive.getState(), hddfancontrol.Drive.DriveState.UNKNOWN)
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.
Fixed. Please re-run the test because most of them failed with error:
coveralls.exception.CoverallsException: Could not submit coverage: 422 Client Error: Unprocessable Entity for url: https://coveralls.io/api/v1/jobs
@@ -244,9 +243,8 @@ def test_isSleeping(self): | |||
universal_newlines=True, | |||
) | |||
with unittest.mock.patch("hddfancontrol.subprocess.check_output") as subprocess_check_output_mock: | |||
subprocess_check_output_mock.side_effect = subprocess.CalledProcessError(0, "") |
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.
Same remark as above, and this a test for isSleeping
so we should be testing that, not getState
.
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.
Fixed
Rebased, squashed and merged separately in f74a475 |
hdparm -C
on WD SSD Black SN750 M.2 returns no output.