File size: 385 Bytes
b5d1dbc
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from solution import parse_duration

CASES = [
    (('1h30m',), 5400),
    (('90m',), 5400),
]

failed = 0
for args, want in CASES:
    got = parse_duration(*args)
    status = 'ok' if got == want else 'FAIL'
    failed += status == 'FAIL'
    print(status, 'parse_duration', args, '->', repr(got), '(expected', repr(want) + ')')
print('passed', len(CASES) - failed, 'of', len(CASES))