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:
-
42dc74859bd372227cf21829c4f3b4673549e2d51d8b6169a9cd0c8c4926e450a601f7dc597c4a60
- 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:
-
WIP: adding tests for utils.datesAdding tests for utils.dates
- Commit:
-
1d8b6169a9cd0c8c4926e450a601f7dc597c4a6040f34d95e2f5313901d878152575ce50f81db7af
- 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:
-
40f34d95e2f5313901d878152575ce50f81db7afe372712ec4518183707994fa39aa5d438927ad35
- Diff:
-
Revision 4 (+44 -1)
-
Tool: Pyflakes Processed Files: djblets/util/tests.py Tool: PEP8 Style Checker Processed Files: djblets/util/tests.py
- Commit:
-
e372712ec4518183707994fa39aa5d438927ad353c2e8c9c242034468157415adcf98552396dac7d
- 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:
-
3c2e8c9c242034468157415adcf98552396dac7d71eddd61507d105c8d46cf4a5b4a7d4a31dcf07b
- Diff:
-
Revision 6 (+44)