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

Add test for sorted/uniqueness of motion label hashes #59

Open
jam1garner opened this issue Apr 4, 2021 · 2 comments
Open

Add test for sorted/uniqueness of motion label hashes #59

jam1garner opened this issue Apr 4, 2021 · 2 comments
Labels
good first issue Good for newcomers mentorship available Help is available for those who want to contribute but need help to

Comments

@jam1garner
Copy link
Member

Once #58 is handled, we'd probably want our tests to ensure nobody merges any non-sorted changes. This will keep people from forgetting to run the script, making everyone's life easier in the process.

@jam1garner jam1garner added good first issue Good for newcomers mentorship available Help is available for those who want to contribute but need help to labels Apr 4, 2021
@himanshu007-creator
Copy link

Hi, i would like to work on this issue ( with assistance)🙂

@jam1garner
Copy link
Member Author

Awesome @himanshu007-creator! For starters I would recommend taking a look here:

https://github.com/ultimate-research/param-labels/blob/master/test_hashes.py#L7-L25

It is the equivalent test for param hashes. It is designed for use with pytest, so the function name is test_*. The main differences between motion_labels/Labels.txt and ParamLabels.csv is that motion labels doesn't also include the hash. This means:

  • When you compute the hash you don't need to verify it against the user-provided one
  • You don't need to parse the label out, the entire line is the label (i.e. the .split by commas is no longer needed)

My recommendation is using assert_is_sorted to ensure the labels are sorted, then use a set like alreadyFoundHashes = set() in order to ensure none of the labels are repeating (assert not hash in alreadyFoundHashes)

Just a heads up I wouldn't recommend this issue if you got here from browsing github, as you may find some of the Smash-Modding-specific parts confusing, but if that's the case I appreciate the enthusiasm even if it isn't a good fit :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers mentorship available Help is available for those who want to contribute but need help to
Projects
None yet
Development

No branches or pull requests

2 participants