Skip to content
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

replaygain: Handle invalid XML output from bs1770gain #3247

Merged
merged 1 commit into from
May 2, 2019

Conversation

jackwilsdon
Copy link
Member

@jackwilsdon jackwilsdon commented May 1, 2019

I've opened this as a draft as I'm not 100% happy with my test implementation (and also the wording of the error itself). I implemented the test in the way I did as I didn't want us to actually require bs1770gain to run the test, as we are mocking the tool's output anyway. This meant that we couldn't use the existing ReplayGainLdnsCliTest class as it extends ReplayGainCliTestBase, which tries to run a whole suite of tests on the backend.

I'm not a fan of patching beetsplug.replaygain.call, as it's a somewhat "internal" feature of the plugin, but I couldn't see another way to mock the output from bs1770gain.


Fixes #2983

Copy link
Member

@sampsyo sampsyo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool; thank you! The testing looks perfectly good to me—I understand your discomfort with mocking the call method, but it's a pretty straightforward way to get this done. 🚢

beetsplug/replaygain.py Outdated Show resolved Hide resolved
@jackwilsdon jackwilsdon marked this pull request as ready for review May 2, 2019 00:25
@sampsyo sampsyo merged commit f09088d into beetbox:master May 2, 2019
sampsyo added a commit that referenced this pull request May 2, 2019
replaygain: Handle invalid XML output from bs1770gain
sampsyo added a commit that referenced this pull request May 2, 2019
sampsyo added a commit that referenced this pull request May 2, 2019
@sampsyo
Copy link
Member

sampsyo commented May 2, 2019

Wonderful; thanks again!! 🎉

@jackwilsdon
Copy link
Member Author

I realise I didn't update the test with the new message, oops! Cheers for sorting it out 👍 appreciated as always.

@jackwilsdon jackwilsdon deleted the b1770gain-malformed-xml branch May 2, 2019 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

replaygain: Handle invalid XML output from bs1770gain
2 participants