Example #1
0
def test_metric_tuple():
    results = [('metric', 'one', 'int', '1'),
               ('metric', 'two', 'string', 'tea for two and two for tea'),
               False, False]
    for line, expected in zip(METRIC_CASES, results):
        test.eq_(ck.metric_tuple(line), expected)
    for line, exc in METRIC_EXCEPTIONS:
        test.assert_raises(exc, ck.metric_tuple, line)
Example #2
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)