Пример #1
0
def test_pformat_list__wrapped():
    assert_equal(_pformat_list([3, 2, 1], width=1), "[3,\n 2,\n 1]")
    assert_equal(_pformat_list([3, 2, 1], width=2), "[3,\n 2,\n 1]")
    assert_equal(_pformat_list([3, 2, 1], width=3), "[3,\n 2,\n 1]")
    assert_equal(_pformat_list([3, 2, 1], width=4), "[3,\n 2,\n 1]")
    assert_equal(_pformat_list([3, 2, 1], width=5), "[3,\n 2,\n 1]")
    assert_equal(_pformat_list([3, 2, 1], width=6), "[3, 2,\n 1]")
    assert_equal(_pformat_list([3, 2, 1], width=7), "[3, 2,\n 1]")
    assert_equal(_pformat_list([3, 2, 1], width=8), "[3, 2,\n 1]")
    assert_equal(_pformat_list([3, 2, 1], width=9), "[3, 2, 1]")
    assert_equal(_pformat_list([3, 2, 1], width=10), "[3, 2, 1]")
Пример #2
0
def test_pformat_list__wrapped():
    assert_equal(_pformat_list([3, 2, 1], width=1), "3 \\\n    2 \\\n    1")
    assert_equal(_pformat_list([3, 2, 1], width=2), "3 \\\n    2 \\\n    1")
    assert_equal(_pformat_list([3, 2, 1], width=3), "3 \\\n    2 \\\n    1")
    assert_equal(_pformat_list([3, 2, 1], width=4), "3 2 \\\n    1")
    assert_equal(_pformat_list([3, 2, 1], width=5), "3 2 \\\n    1")
    assert_equal(_pformat_list([3, 2, 1], width=6), "3 2 1")
    assert_equal(_pformat_list([3, 2, 1], width=7), "3 2 1")
Пример #3
0
def test_pformat_list__wrapped():
    assert _pformat_list([3, 2, 1], width=1) == "3 \\\n    2 \\\n    1"
    assert _pformat_list([3, 2, 1], width=2) == "3 \\\n    2 \\\n    1"
    assert _pformat_list([3, 2, 1], width=3) == "3 \\\n    2 \\\n    1"
    assert _pformat_list([3, 2, 1], width=4) == "3 2 \\\n    1"
    assert _pformat_list([3, 2, 1], width=5) == "3 2 \\\n    1"
    assert _pformat_list([3, 2, 1], width=6) == "3 2 1"
    assert _pformat_list([3, 2, 1], width=7) == "3 2 1"
Пример #4
0
def test_pformat_list__wrapped():
    assert_equal(_pformat_list([3, 2, 1], width=1), "3 \\\n    2 \\\n    1")
    assert_equal(_pformat_list([3, 2, 1], width=2), "3 \\\n    2 \\\n    1")
    assert_equal(_pformat_list([3, 2, 1], width=3), "3 \\\n    2 \\\n    1")
    assert_equal(_pformat_list([3, 2, 1], width=4), "3 2 \\\n    1")
    assert_equal(_pformat_list([3, 2, 1], width=5), "3 2 \\\n    1")
    assert_equal(_pformat_list([3, 2, 1], width=6), "3 2 1")
    assert_equal(_pformat_list([3, 2, 1], width=7), "3 2 1")
Пример #5
0
def test_pformat_list__escaped():
    assert_equal(_pformat_list(["a", "b c"], width=100), "a 'b c'")
    assert_equal(_pformat_list(["a", "$c"], width=100), "a '$c'")
    assert_equal(_pformat_list(["!a", "c"], width=100), "'!a' c")
    assert_equal(_pformat_list(["a", "'c"], width=100), """a ''"'"'c'""")
Пример #6
0
def test_pformat_list__multiple():
    assert_equal(_pformat_list([3, 2, 1]), "3 2 1")
Пример #7
0
def test_pformat_list__single():
    assert_equal(_pformat_list([3]), "3")
Пример #8
0
def test_pformat_list__empty():
    assert_equal(_pformat_list([]), "")
Пример #9
0
def test_pformat_list__escaped():
    assert _pformat_list(["a", "b c"], width=100) == "a 'b c'"
    assert _pformat_list(["a", "$c"], width=100) == "a '$c'"
    assert _pformat_list(["!a", "c"], width=100) == "'!a' c"
    assert _pformat_list(["a", "'c"], width=100) == """a ''"'"'c'"""
Пример #10
0
def test_pformat_list__multiple():
    assert _pformat_list([3, 2, 1]) == "3 2 1"
Пример #11
0
def test_pformat_list__single():
    assert _pformat_list([3]) == "3"
Пример #12
0
def test_pformat_list__empty():
    assert _pformat_list([]) == ""
Пример #13
0
def test_pformat_list__escaped():
    assert_equal(_pformat_list(["a", "b c"], width=100), "a 'b c'")
    assert_equal(_pformat_list(["a", "$c"], width=100), "a '$c'")
    assert_equal(_pformat_list(["!a", "c"], width=100), "'!a' c")
    assert_equal(_pformat_list(["a", "'c"], width=100), """a ''"'"'c'""")
Пример #14
0
def test_pformat_list__multiple():
    assert_equal(_pformat_list([3, 2, 1]), "3 2 1")
Пример #15
0
def test_pformat_list__single():
    assert_equal(_pformat_list([3]), "3")
Пример #16
0
def test_pformat_list__empty():
    assert_equal(_pformat_list([]), "")