-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
fix_add_special_feature_tests #778 #783
base: master
Are you sure you want to change the base?
fix_add_special_feature_tests #778 #783
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.
Thank you for splitting the pull request.
First I have a question.
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.
Thanks for moving the test code.
Please remove all comments.
Your change can "Explain Yourself in Code (ref: Clean Code)", so it seems that there is no need for comments
@ftnext done ✅ |
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.
Thank you for the fix so far.
I have added comments on more specifics as the code has become more concise.
@@ -141,6 +141,16 @@ def test_flac_stereo_24_bit(self): | |||
else: | |||
self.assertSimilar(audio.get_raw_data()[:32], b"\x00\x00\x00\x00\x00\x00\xfe\xff\x00\x00\x02\x00\x00\x00\xfe\xff\x00\x00\x00\x00\x00\xff\x01\x00\x00\x02\xfc\xff\x00\xfe\x01\x00") | |||
|
|||
def test_incompatible_audio_file_error(self): | |||
self.AUDIO_FILE_EN_MP3 = path.join(path.dirname(path.realpath(__file__)), "english.mp3") |
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.
self.AUDIO_FILE_EN_MP3
-> AUDIO_FILE_EN_MP3
self
seems to be unnecessary.
self.AUDIO_FILE_EN_MP3 = path.join(path.dirname(path.realpath(__file__)), "english.mp3") | ||
r = sr.Recognizer() | ||
with self.assertRaises(ValueError) as context: | ||
with sr.AudioFile(self.AUDIO_FILE_EN_MP3) as source:r.record(source) |
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.
with sr.AudioFile(AUDIO_FILE_EN_MP3) as source:
pass
Test target is AudioFile.__enter__()
, so Recognizer is not required.
The test_incompatible_audio_file_error test failed and raised the ValueError as mp3 format.
The test_sphinx_keywords fixed the tests before as they failed
Issue #778