Added tests for `parse_timestmp` of `djblets.log.views` to address missing test cases
Review Request #9504 — Created Jan. 20, 2018 and updated — Latest diff uploaded
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.