示例#1
0
def test_count_followers():
    eq_(ctw._count_followers("", ""), (0, 0))
    eq_(ctw._count_followers("", "00111"), (2, 3))
    eq_(ctw._count_followers("0", "00111"), (1, 1))
    eq_(ctw._count_followers("1", "00111"), (0, 2))
    eq_(ctw._count_followers("010", "00101011"), (0, 2))

    eq_(ctw._count_followers("", "0"), (1, 0))
    eq_(ctw._count_followers("", "1"), (0, 1))
    eq_(ctw._count_followers("0", "0"), (0, 0))
    eq_(ctw._count_followers("1", "1"), (0, 0))
示例#2
0
def test_count_followers():
    eq_(ctw._count_followers("", ""), (0, 0))
    eq_(ctw._count_followers("", "00111"), (2, 3))
    eq_(ctw._count_followers("0", "00111"), (1, 1))
    eq_(ctw._count_followers("1", "00111"), (0, 2))
    eq_(ctw._count_followers("010", "00101011"), (0, 2))

    eq_(ctw._count_followers("", "0"), (1, 0))
    eq_(ctw._count_followers("", "1"), (0, 1))
    eq_(ctw._count_followers("0", "0"), (0, 0))
    eq_(ctw._count_followers("1", "1"), (0, 0))
示例#3
0
 def p_func(seq):
     counts = ctw._count_followers("", seq)
     return estimator(*counts)
示例#4
0
 def p_func(seq):
     counts = ctw._count_followers("", seq)
     return estimator(*counts)