Skip to content

Conversation

@pkess
Copy link
Contributor

@pkess pkess commented Sep 20, 2015

Here's my second test. I want to check the command "fields" of beets. I think the coverage of this would be ok now, but at the moment i don't check the output of the program. So i don't really want you to merge this branch at the moment.

Do you have any suggestions, how we should test it? I think it would not make sense to test it against a fixed list of text.

first check of function without check of consistent output
Copy link
Member

Choose a reason for hiding this comment

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

If you inherit from _common.LibTestCase instead of plain _common.TestCase, you'll get self.lib for free.

@sampsyo
Copy link
Member

sampsyo commented Sep 20, 2015

Looking good! Yes, checking against a fixed list would work. To make the test slightly more robust to changes, though, it may be a good idea to read out Item._fields for the ground truth on fixed attributes (so things don't break every time we add a new one).

It might also be nice to check the display of plugin-provided fields, which would involve cooking up a dummy plugin for the test.

@pkess
Copy link
Contributor Author

pkess commented Sep 25, 2015

ok, i just added a method to test the output (not very strong, but robust against changes in output)

@sampsyo
Copy link
Member

sampsyo commented Sep 25, 2015

Looks ideal! Thank you again! ✨

sampsyo added a commit that referenced this pull request Sep 25, 2015
added testcase for fields command
@sampsyo sampsyo merged commit 35497ff into beetbox:master Sep 25, 2015
@pkess pkess deleted the test_command_fields branch September 27, 2015 09:07
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.

2 participants