-
Notifications
You must be signed in to change notification settings - Fork 51
Add testing for methods defined in GitGud object #314
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was a bit quick with the comments here to try and be expedient. I think everything is covered. Let me know if you need clarification.
Also, at this point, I think creating levels is the priority, not necessarily the tests, so don't feel like you're obligated to write all these tests
pass | ||
def test_handle_commit(): | ||
pass | ||
def test_handle_contrib(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No test
pass | ||
def test_handle_contrib(): | ||
pass | ||
def test_handle_debug(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No test
|
||
from gitgud.__main__ import GitGud | ||
|
||
def test_assert_initialized(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test in git gud repo, git repo, empty directory
pass | ||
def test_handle_test(): | ||
pass | ||
def test_is_initialized(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test with assert_initilized
|
||
def test_assert_initialized(): | ||
pass | ||
def test_handle_commit(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we might be removing this, no test yet unless you want to
pass | ||
def test_handle_reset(): | ||
pass | ||
def test_handle_show(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test with show-tree
pass | ||
def test_handle_skills(): | ||
pass | ||
def test_handle_solution(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same tests as other user facing commands, but obviously this one, you'll need to test the --confirm flag
pass | ||
def test_handle_status(): | ||
pass | ||
def test_handle_test(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Load up a level and make sure that it it doesn't fail either when the level has been completed or when it hasn't
Also make sure it doesn't fail if we're not in a git dir
pass | ||
def test_load_level(): | ||
pass | ||
def test_parse(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test git gud
without any subcommands in git dir and non-git dir
pass | ||
def test_is_initialized(): | ||
pass | ||
def test_load_level(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commits.csv
should be modified after this func is run, and the level file should correspond to the one loaded.
There should be a test for this in test_operator.py
if there isn't one already
It might (probably will) make sense to split this up into multiple PRs |
If you'd like multiple PRs, would you also like multiple issues for this? E.g. "Test user methods using webbrowser", "Test user methods related to loading", "Test assert initialized methods", etc? |
Yes, I think that makes sense. Obviously, there would be many issues, and writing the issues might take as long as it takes to simply write the test, so do what you feel is right. There should either be a pull request or an issue for each test |
What we could do is make a new "meta-issue", similar to what #238 is. Each checkbox could be a method in the GitGud object. Going off of this, we could maintain another branch I'm not sure what's best, so it's your call. As an aside, should this PR be closed? |
I think we can open a meta-issue (along with other issues) I don't think we need to make a separate branch for the tests, I think we can merge them right into master when they are done. This PR can stay open until there exists other issues/PRs that make use of the useful comments that are here |
Stale/closing |
Fixes #197
@benthayer Could you verify for which methods you would like tests?