Пример #1
0
def test_stringy():
    assert stringy(3) == '101'
    assert stringy(5) == '10101'
    assert stringy(12) == '101010101010'
    assert stringy(26) == '10101010101010101010101010'
    assert stringy(28) == '1010101010101010101010101010'
Пример #2
0
def test_length():
    for i in xrange(1, 5):
        assert len(stringy(i)) == i
Пример #3
0
def test_string():
    assert str(type(stringy(5)))[1:-1] == "type 'str'"
Пример #4
0
def test_start_with_1():
    assert stringy(10)[0] == '1'
Пример #5
0
def test_output():
    assert stringy(1) == '1'
    assert stringy(2) == '10'
    assert stringy(5) == '10101'
    assert stringy(10) == '1010101010'
    assert stringy(13) == '1010101010101'