示例#1
0
def test_invoc_repr():
    def func(a, b, c=None):
        pass

    assert "func(a, b, c=c)" == backoff._invoc_repr(func,
                                                    ["a", "b"],
                                                    {"c": "c"})
    assert "func(c=c)" == backoff._invoc_repr(func, [], {"c": "c"})
    assert "func(a, b)" == backoff._invoc_repr(func, ["a", "b"], {})
示例#2
0
def test_invoc_repr():
    def func(a, b, c=None):
        pass

    assert "func(a, b, c=c)" == backoff._invoc_repr(func, ["a", "b"],
                                                    {"c": "c"})
    assert "func(c=c)" == backoff._invoc_repr(func, [], {"c": "c"})
    assert "func(a, b)" == backoff._invoc_repr(func, ["a", "b"], {})
    assert u"func(ユニコーン, ア=あ)" == \
        backoff._invoc_repr(func, [u"ユニコーン"], {u"ア": u"あ"})
示例#3
0
def test_invoc_repr():
    def func(a, b, c=None):
        pass

    assert "func(a, b, c=c)" == backoff._invoc_repr(func,
                                                    ["a", "b"],
                                                    {"c": "c"})
    assert "func(c=c)" == backoff._invoc_repr(func, [], {"c": "c"})
    assert "func(a, b)" == backoff._invoc_repr(func, ["a", "b"], {})
    assert u"func(ユニコーン, ア=あ)" == \
        backoff._invoc_repr(func, [u"ユニコーン"], {u"ア": u"あ"})
示例#4
0
def test_invoc_repr():
    def func(a, b, c=None):
        pass

    assert "func(a, b, c=c)" == backoff._invoc_repr(func, ["a", "b"],
                                                    {"c": "c"})
    assert "func(c=c)" == backoff._invoc_repr(func, [], {"c": "c"})
    assert "func(a, b)" == backoff._invoc_repr(func, ["a", "b"], {})
    assert u"func(ユニコーン, ア=あ)" == \
        backoff._invoc_repr(func, [u"ユニコーン"], {u"ア": u"あ"})

    # tuple args caused a string formatting exception
    assert "func((1, 2, 3))" == backoff._invoc_repr(func, [(1, 2, 3)], {})
def test_invoc_repr():
    def func(a, b, c=None):
        pass

    assert "func(a, b, c=c)" == backoff._invoc_repr(func,
                                                    ["a", "b"],
                                                    {"c": "c"})
    assert "func(c=c)" == backoff._invoc_repr(func, [], {"c": "c"})
    assert "func(a, b)" == backoff._invoc_repr(func, ["a", "b"], {})
    assert u"func(ユニコーン, ア=あ)" == \
        backoff._invoc_repr(func, [u"ユニコーン"], {u"ア": u"あ"})

    # tuple args caused a string formatting exception
    assert "func((1, 2, 3))" == backoff._invoc_repr(func, [(1, 2, 3)], {})