-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Added code to raise exception with string #1952
Conversation
@stef405 I fixed the code for the checkboxes and moved it to the end of your PR description. They are meant to be ticked off to give an idea of what was done at a quick glance. |
Looks like the formatting needs some more work. |
1 similar comment
1 similar comment
@stef405 You can combine the changes into one commit and force-push the PR, no need to add to the log when it's something so small which could have been caught earlier. |
Reformat files for code format check
@keikoro I combined the commits. There should now be only one commit associated with this PR |
I added two lines to VideoClip.py that raises an exception if a user passes in a string as the color parameter. This is in reaction to this Bug. The problem the original user faced was that it raised a ValueError. The user inputted 'black' as the color in ColorClip, which is not an acceptable parameter for the function. Instead, I just created some code that checks if color is a string, and raises an exception that mentions the wrong user input. In the future, a user should hopefully realize quicker that they passed in incorrect input with the Exception message, instead of not knowing why a ValueError was thrown later on.
To test_color() in test_VideoClip.py, I added a test that attempts to create a Clip with color = 'black'. The test passes, since an exception should be thrown when color is passed in as a string.
I also checked for PEP8 conventions in both files, and none of the code I added resulted in a style complaint.
tests/