Ejemplo n.º 1
0
def test_status_line():
    ### At this point we've tested status_tuple() and
    ### is_status_line(), so we can use them.
    results = zip([ck.status_tuple(line) for line in STATUS_CASES
                   if ck.is_status_line(line)],
                  [line for line in STATUS_CASES
                   if ck.is_status_line(line)])
    for tpl, line in results:
        test.eq_(ck.status_line(tpl), line)
Ejemplo n.º 2
0
def test_status_tuple():
    results = [('status', 'ok', 'this is a valid ok status line'),
               ('status', 'warn', 'this is a valid warning status line'),
               ('status', 'err', 'this is a valid error status line'),
               False, False, False]
    for line, expected in zip(STATUS_CASES, results):
        test.eq_(ck.status_tuple(line), expected)
    for line, exc in STATUS_EXCEPTIONS:
        test.assert_raises(exc, ck.status_tuple, line)