-
Notifications
You must be signed in to change notification settings - Fork 33
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
More utils tests #113
More utils tests #113
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.
No covering the IO is fine, but the others I think could easily have tests written for them.
superflore/utils.py
Outdated
@@ -59,7 +59,7 @@ def get_pkg_version(distro, pkg_name): | |||
return maj_min_patch | |||
|
|||
|
|||
def rand_ascii_str(length=10): | |||
def rand_ascii_str(length=10): # pragma: no cover |
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.
This one you could test returns only ascii characters and that the length is as expected.
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.
Also a good point. Thanks.
superflore/utils.py
Outdated
print(colored('>>>> {0}'.format(string), 'cyan')) | ||
|
||
|
||
def make_dir(dirname): | ||
def make_dir(dirname): # pragma: no cover |
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.
This could be trivially tested in a tempdir. It would be good to add tests for the different edge cases such as the directory existing, not existing, is file, and not writable.
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.
That's a good point. Will do.
21ed383
to
7e2f60c
Compare
Latest report below. Getting better! I'd say the next priority is
|
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.
thanks for the extra tests.
* Skip print functions during coverage check. * Add more license tests. * Add test for make_dir. * Add test for random ascii strings.
Mark certain functions with
# pragma: no cover
so that they don't get counted in the coverage results, as well as add a bit more to the license tests.