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

AB-330: Class name range check #254

Merged
merged 3 commits into from Feb 20, 2018
Merged

AB-330: Class name range check #254

merged 3 commits into from Feb 20, 2018

Conversation

rsh7
Copy link
Contributor

@rsh7 rsh7 commented Feb 9, 2018

Changed the range check of higher value from MIN to MAX.

@alastair
Copy link
Collaborator

Thanks for this patch. Also, good catch with the bad variables in the error message! 👏
If you find two things to fix that are related, you can add them both to the same pull request. You don't need to open a separate one.

Please make sure you read the CONTRIBUTING guidelines, especially the section about writing good commit messages. Make sure your commit messages and pull request descriptions clearly describe the change that you have made.

@@ -139,10 +139,10 @@ def validate_class(cls, idx=None, recordings_required=True):
# Name
Copy link
Collaborator

Choose a reason for hiding this comment

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

We have some tests for the dataset validator at https://github.com/RashiSah/acousticbrainz-server/blob/b00f1f849ef2ba6041c308755c7de4dbcb90f699/utils/dataset_validator.py. It would be good to make sure that we have tests for these three methods that you changed so that we can be sure that they work as expected.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Whoops, I meant to say https://github.com/RashiSah/acousticbrainz-server/blob/b00f1f849ef2ba6041c308755c7de4dbcb90f699/utils/test/test_dataset_validator.py

It looks like we have tests for most things regarding the structure of the dataset dictionary, but we don't have any tests to check that an error is shown if the names of classes or datasets are longer or shorter than the given values. We should add 3 more tests that provide names that are too short, and too long, and check that the correct exception is raised.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added tests for the dataset or class names that are too short or too long than the specified ranges.

@rsh7 rsh7 changed the title Class name range check AB-330: Class name range check Feb 16, 2018
Copy link
Collaborator

@paramsingh paramsingh left a comment

Choose a reason for hiding this comment

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

💯 🥇 🚢 🚀

@alastair alastair merged commit 83a3ddc into metabrainz:master Feb 20, 2018
@alastair
Copy link
Collaborator

Great, thanks!

Just as a note, you can make long strings in python by doing something like

"a"*100

which results in a string that is just as long (but maybe a little more boring than yours :) )

@rsh7 rsh7 deleted the check branch March 21, 2018 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants