def test_word_to_number_fail(): failed = False try: sure.word_to_number('twenty') except AssertionError, e: failed = True assert_equals( unicode(e), 'sure supports only literal numbers from one ' \ 'to twelve, you tried the word "twenty"')
def test_word_to_number_fail(): failed = False try: sure.word_to_number("twenty") except AssertionError as e: failed = True assert_equals( text_type(e), "sure supports only literal numbers from one " 'to twelve, you tried the word "twenty"' ) assert failed, "should raise assertion error"
def test_word_to_number_fail(): failed = False try: sure.word_to_number('twenty') except AssertionError as e: failed = True assert_equals( text_type(e), 'sure supports only literal numbers from one ' \ 'to twelve, you tried the word "twenty"') assert failed, 'should raise assertion error'
def test_word_to_number(): assert_equals(sure.word_to_number("one"), 1) assert_equals(sure.word_to_number("two"), 2) assert_equals(sure.word_to_number("three"), 3) assert_equals(sure.word_to_number("four"), 4) assert_equals(sure.word_to_number("five"), 5) assert_equals(sure.word_to_number("six"), 6) assert_equals(sure.word_to_number("seven"), 7) assert_equals(sure.word_to_number("eight"), 8) assert_equals(sure.word_to_number("nine"), 9) assert_equals(sure.word_to_number("ten"), 10) assert_equals(sure.word_to_number("eleven"), 11) assert_equals(sure.word_to_number("twelve"), 12)
def test_word_to_number(): assert_equals(sure.word_to_number('one'), 1) assert_equals(sure.word_to_number('two'), 2) assert_equals(sure.word_to_number('three'), 3) assert_equals(sure.word_to_number('four'), 4) assert_equals(sure.word_to_number('five'), 5) assert_equals(sure.word_to_number('six'), 6) assert_equals(sure.word_to_number('seven'), 7) assert_equals(sure.word_to_number('eight'), 8) assert_equals(sure.word_to_number('nine'), 9) assert_equals(sure.word_to_number('ten'), 10) assert_equals(sure.word_to_number('eleven'), 11) assert_equals(sure.word_to_number('twelve'), 12)