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` |
brennie | |
The bug number should go in the bugs field. The bug number should not be in the summary or description. |
brennie | |
You will want to give our guide on change descriptions a read and edit your summary and description to match. … |
brennie | |
Can you wrap your description and testing done at 72 characters? |
brennie | |
Testing done needs to be capitalized and should end in a period. |
brennie | |
Needs a file-level docstring describing the module. "Unit tests for djblets.log.views" is fine. |
brennie | |
Unnecessary. |
brennie | |
Needs a docstring. |
brennie | |
Needs a docstring. |
brennie | |
Needs a docstring. |
brennie | |
Needs a docstring. invalid_date. |
brennie | |
valid_date (reads like validate otherwise) Also needs a docstring. |
brennie | |
Test docstrings shouldn't end in periods because the test runner will append a "..." |
david | |
Same heere. |
david | |
And here. |
david | |
And here. |
david | |
Proper grammar should be "There aren't 55 months" |
david |
-
-
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.
-
-
-
-
-
-
-
- Change Summary:
-
updated description
- Description:
-
~ Added test for djblets.log.views to address 4590
~ 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 get more accurate testing would be testing the default implementation for time and datetime, which might be something to be considered with future changes to python version however isn't required for the scope of this project.+ + This is based off 4590 which was requesting test cases to prevent possible regressions in
djblets.log.views
since no tests were provided for this file.+ This doesn't resolve 4590 but it addresses part of the issue. - Testing Done:
-
~ ran './tests/runtests djblets.log.tests' and './tests/runtests djblets.log'
~ ran
./tests/runtests djblets.log.tests
and./tests/runtests djblets.log
and both pass along with all other test cases - Bugs:
- Change Summary:
-
Addressed comments raised by Barret about missing doc strings, typo's in function names, and unnecessary comment.
Checks run (2 succeeded)
- Description:
-
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 get more accurate testing would be testing the default implementation for time and datetime, which might be something to be considered with future changes to python version however isn't required for the scope of this project.- - This is based off 4590 which was requesting test cases to prevent possible regressions in
djblets.log.views
since no tests were provided for this file.- This doesn't resolve 4590 but it addresses part of the issue.
- Change Summary:
-
Address formatting, punctuation, and doctrings
- Description:
-
~ Added tests for
djblets.log.views
for testing theparse_timestamp
function.~ Added tests for
djblets.log.views
for testing theparse_timestamp
+ function. ~ The included tests try the following cases with provided timestamp format string:
~ 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'
)~ - 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 get more accurate testing would be testing the default implementation for time and datetime, which might be something to be considered with future changes to python version however isn't required for the scope of this project.~ 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. - Testing Done:
-
~ ran
./tests/runtests djblets.log.tests
and./tests/runtests djblets.log
and both pass along with all other test cases~ I ran
./tests/runtests djblets.log.tests
and+ ./tests/runtests djblets.log
and both pass along with+ all other test cases.