Commit c9f81b9
Simon Coffey
Add unit coverage for Utils.parse_duration
This adds some more comprehensive unit testing for the .parse_duration
helper, since we'd like to modify it for better coverage of the ISO8601
duration spec.
Since the helper both parses the duration and adds it to the current
time (by default) before returning it, I've used the unix epoch as a
reference point instead and formatted the result as an ISO timestamp
before asserting, to hopefully make any errors clearer.
I've not gone for full coverage, but have tried to test the main edge
cases. In subsequent commits I'll refactor the parsing and introduce
support for fractional values.1 parent b55733f commit c9f81b9
1 file changed
+35
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
4 | 39 | | |
5 | 40 | | |
6 | 41 | | |
| |||
0 commit comments