Example #1
0
def test_metric_line():
    ### At this point we've tested metric_tuple() and
    ### is_metric_line(), so we can use them.
    results = zip([ck.metric_tuple(line) for line in METRIC_CASES
                   if ck.is_metric_line(line)],
                  [line for line in METRIC_CASES
                   if ck.is_metric_line(line)])
    for tpl, line in results:
        test.eq_(ck.metric_line(tpl), line)
Example #2
0
def test_get_metric_lines():
    ### At this point we've tested is_metric_line() so we can use it.
    assert all([ck.is_metric_line(line) for line in
                ck.get_metric_lines(METRIC_CASES)])
Example #3
0
def test_is_metric_line():
    results = [True, True, False, False]
    for line, expected in zip(METRIC_CASES, results):
        test.eq_(ck.is_metric_line(line), expected)
    for line, exc in METRIC_EXCEPTIONS:
        test.assert_raises(exc, ck.is_metric_line, line)