Added tests for `parse_timestmp` of `djblets.log.views` to address missing test cases
Review Request #9504 — Created Jan. 20, 2018 and updated
Added tests for
djblets.log.views
for testing theparse_timestamp
function.The included tests try the following cases with provided timestamp
format string:
- Empty String of''
being passed
- A string containing something other than a date ('jibberish'
)
- An invalid date where the month is out of bounds
('1990-55-09 22:11:30'
)
- A valid date input string ('1990-01-01 20:20:20'
)Based most of this behavior off how
parse_timestamp
behaved in the
interpreter with various inputs. To be more accurate with testing
would require the default implementation for time and datetime,
which mightbe something to be considered with future changes to
python versions however but isn't required for
the scope of this project.
I ran
./tests/runtests djblets.log.tests
and
./tests/runtests djblets.log
and both pass along with
all other test cases.
Description | From | Last Updated |
---|---|---|
Your testing done should be capititalized appropriately. You can make the bits look like code with: `code` |
|
|
The bug number should go in the bugs field. The bug number should not be in the summary or description. |
|
|
You will want to give our guide on change descriptions a read and edit your summary and description to match. … |
|
|
Can you wrap your description and testing done at 72 characters? |
|
|
Testing done needs to be capitalized and should end in a period. |
|
|
Needs a file-level docstring describing the module. "Unit tests for djblets.log.views" is fine. |
|
|
Unnecessary. |
|
|
Needs a docstring. |
|
|
Needs a docstring. |
|
|
Needs a docstring. |
|
|
Needs a docstring. invalid_date. |
|
|
valid_date (reads like validate otherwise) Also needs a docstring. |
|
|
Test docstrings shouldn't end in periods because the test runner will append a "..." |
|
|
Same heere. |
|
|
And here. |
|
|
And here. |
|
|
Proper grammar should be "There aren't 55 months" |
|
-
-
Your testing done should be capititalized appropriately.
You can make the bits look like code with:
`code`
-
The bug number should go in the bugs field.
The bug number should not be in the summary or description.
-
You will want to give our guide on change descriptions a read and edit your summary and description to match. Change descriptions should be stand-alone and not require looking up a bug to find out what the change does.
-
djblets/log/tests/test_log_views.py (Diff revision 1) Needs a file-level docstring describing the module. "Unit tests for djblets.log.views" is fine.
-
-
-
-
-
-
djblets/log/tests/test_log_views.py (Diff revision 1) valid_date
(reads like validate otherwise)Also needs a docstring.
Change Summary:
updated description
Description: |
|
|||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Testing Done: |
|
|||||||||||||||||||||||||||||||||||||||
Bugs: |
|
Change Summary:
Addressed comments raised by Barret about missing doc strings, typo's in function names, and unnecessary comment.
Diff: |
Revision 2 (+33) |
---|
Checks run (2 succeeded)
Description: |
|
---|
-
-
djblets/log/tests/test_log_views.py (Diff revision 2) Test docstrings shouldn't end in periods because the test runner will append a "..."
-
-
-
Change Summary:
Address formatting, punctuation, and doctrings
Description: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Testing Done: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Diff: |
Revision 3 (+33) |
Checks run (2 succeeded)
-
-
djblets/log/tests/test_log_views.py (Diff revision 3) Proper grammar should be "There aren't 55 months"