예제 #1
0
파일: test_sure.py 프로젝트: pjdelport/sure
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"')
예제 #2
0
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"')
예제 #3
0
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"
예제 #4
0
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'
예제 #5
0
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)
예제 #6
0
파일: test_sure.py 프로젝트: pjdelport/sure
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)
예제 #7
0
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)