* adjusted past_format and future_format to past_tense and future_tense
* corrected all tests and documentation to reflect new keyword argument names
* changed example _tense strings to use {} instead of {0}
* cleaned up docstrings
This commit is contained in:
parent
3cbd5101b3
commit
fb0ffca26e
3 changed files with 27 additions and 27 deletions
16
test_ago.py
16
test_ago.py
|
|
@ -41,17 +41,17 @@ def test_one_day_singular():
|
|||
def test_two_day_plural():
|
||||
assert 's' in delta2human( timedelta(2) )
|
||||
|
||||
def test_past_format():
|
||||
def test_past_tense():
|
||||
output = human( PAST,
|
||||
past_format = 'titanic sunk {0} ago',
|
||||
future_format = 'titanic will sink in {0} from now'
|
||||
past_tense = 'titanic sunk {} ago',
|
||||
future_tense = 'titanic will sink in {} from now'
|
||||
)
|
||||
assert 'titanic sunk' in output
|
||||
|
||||
def test_future_format():
|
||||
def test_future_tense():
|
||||
output = human( FUTURE,
|
||||
past_format = 'titanic sunk {0} ago',
|
||||
future_format = 'titanic will sink in {0} from now'
|
||||
past_tense = 'titanic sunk {} ago',
|
||||
future_tense = 'titanic will sink in {} 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, past_format = "Commented {0} ago" )
|
||||
print human( PAST, past_tense = "Commented {} ago" )
|
||||
|
||||
print '\nTesting future:\n'
|
||||
print delta2dict( FUTURE_DELTA )
|
||||
print 'Shutdown ' + delta2human( FUTURE_DELTA, 3 )
|
||||
print human( FUTURE, future_format = 'Shutdown in {0} from now' )
|
||||
print human( FUTURE, future_tense = 'Shutdown in {} from now' )
|
||||
print ''
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue