Adding tests for utils.dates
Review Request #8439 — Created Sept. 25, 2016 and submitted
Djblets has some utility functions for working with dates/timestamps
that did not have any unit tests for them.
The cursor of some text fields in an edit state displayed the standard
Added new DatesTests class to djblets/util/tests.py that covers
testing for:Calling http_date():
- With a datetime object.
- With a string representing a date.
- With an integer representing a Unix timestamp (seconds since the
epoch).Calling get_latest_timestamp():
- Without any timestamps in the list (result should be None)
- With a list of timestamps of different values in a jumbled,
unsorted order, checking that the latest gets returned.Calling get_tz_aware_utcnow() and checking that the resulting
datetime's timezone is UTC
Added tests
Description | From | Last Updated |
---|---|---|
'time' imported but unused |
reviewbot | |
Col: 80 E501 line too long (85 > 79 characters) |
reviewbot | |
djblets.util comes before djblets.util.foo |
brennie | |
http_date |
brennie | |
http_date |
brennie | |
http_date |
brennie | |
UTC is capitalized. |
brennie | |
Undo this. |
brennie | |
Same here. |
brennie | |
Same here. |
brennie | |
Use the function name in the docstring. |
brennie |
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 2 (+22 -1) |
-
Tool: Pyflakes Processed Files: djblets/util/tests.py Tool: PEP8 Style Checker Processed Files: djblets/util/tests.py
Change Summary:
Added unit tests for dates.py
Summary: |
|
||||
---|---|---|---|---|---|
Commit: |
|
||||
Diff: |
Revision 3 (+45 -1) |
-
Tool: Pyflakes Processed Files: djblets/util/tests.py Tool: PEP8 Style Checker Processed Files: djblets/util/tests.py
Change Summary:
Fixed "http date" issues with function doc strings
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 4 (+44 -1) |
-
Tool: Pyflakes Processed Files: djblets/util/tests.py Tool: PEP8 Style Checker Processed Files: djblets/util/tests.py
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 5 (+44) |
-
Tool: Pyflakes Processed Files: djblets/util/tests.py Tool: PEP8 Style Checker Processed Files: djblets/util/tests.py
Change Summary:
fixing test function doc strings
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 6 (+44) |