The format keyword arguments were mismatched between human and delta2human.
The name of these arguments is still up for discussion.
This commit is contained in:
parent
9e841d1266
commit
3cbd5101b3
3 changed files with 16 additions and 16 deletions
12
test_ago.py
12
test_ago.py
|
|
@ -43,15 +43,15 @@ def test_two_day_plural():
|
|||
|
||||
def test_past_format():
|
||||
output = human( PAST,
|
||||
format_past = 'titanic sunk {0} ago',
|
||||
format_future = 'titanic will sink in {0} from now'
|
||||
past_format = 'titanic sunk {0} ago',
|
||||
future_format = 'titanic will sink in {0} from now'
|
||||
)
|
||||
assert 'titanic sunk' in output
|
||||
|
||||
def test_future_format():
|
||||
output = human( FUTURE,
|
||||
format_past = 'titanic sunk {0} ago',
|
||||
format_future = 'titanic will sink in {0} from now'
|
||||
past_format = 'titanic sunk {0} ago',
|
||||
future_format = 'titanic will sink in {0} from now'
|
||||
)
|
||||
assert 'titanic will sink in' in output
|
||||
|
||||
|
|
@ -69,11 +69,11 @@ def test_output():
|
|||
print '\nTesting past:\n'
|
||||
print delta2dict( PAST_DELTA )
|
||||
print 'Commented ' + delta2human( PAST_DELTA, 3 )
|
||||
print human( PAST, format_past = "Commented {0} ago" )
|
||||
print human( PAST, past_format = "Commented {0} ago" )
|
||||
|
||||
print '\nTesting future:\n'
|
||||
print delta2dict( FUTURE_DELTA )
|
||||
print 'Shutdown ' + delta2human( FUTURE_DELTA, 3 )
|
||||
print human( FUTURE, format_future = 'Shutdown in {0} from now' )
|
||||
print human( FUTURE, future_format = 'Shutdown in {0} from now' )
|
||||
print ''
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue