@@ -0,0 +1,1580 @@
+from nose.tools import *%0A%0Afrom lctools.shortcuts import get_node_or_fail%0A%0Aclass TestShortCuts(object):%0A%0A    def setup(self):%0A        class MyNode(object):%0A%0A            def __init__(self, id):%0A                self.id = id%0A%0A        class MyConn(object):%0A%0A            def __init__(self, nodes):%0A                self.nodes = nodes%0A%0A            def list_nodes(self):%0A                return self.nodes%0A%0A        self.node_cls = MyNode%0A        self.conn_cls = MyConn%0A%0A    def test_that_get_node_or_fail_returns_node_object_for_existing_node(self):%0A        conn = self.conn_cls(%5Bself.node_cls(%2215%22), self.node_cls(%2221%22)%5D)%0A%0A        node = get_node_or_fail(conn, %2215%22)%0A%0A        assert_equal(node.id, %2215%22)%0A%0A    def test_that_get_node_or_fail_returns_none_in_fail_case(self):%0A        conn = self.conn_cls(%5B%5D)%0A%0A        node = get_node_or_fail(conn, %2215%22)%0A%0A        assert_true(node is None)%0A%0A    def test_that_get_node_or_fail_calls_coroutine_in_fail_case(self):%0A        class CallableCheck(object):%0A            called = False%0A            args = None%0A            kwargs = None%0A%0A            def __call__(self, *args, **kwargs):%0A                self.called = True%0A                self.args = args%0A                self.kwargs = kwargs%0A%0A        coroutine = CallableCheck()%0A        cargs = (%22Error happened%22,)%0A        ckwargs = %7B%22node_id%22: %2215%22%7D%0A%0A        conn = self.conn_cls(%5B%5D)%0A%0A        node = get_node_or_fail(conn, %2215%22,%0A                coroutine, cargs, ckwargs)%0A%0A        assert_true(coroutine.called)%0A        assert_equal(coroutine.args, cargs)%0A        assert_equal(coroutine.kwargs, ckwargs)%0A

Add tests for new shortcuts.