Exemplo n.º 1
0
def test_trace_variable():
    # A random number of friends and random contacts
    friend_number = random.choice(range(1, 10))
    friends = random.sample(range(100), friend_number)

    trace = generate_trace(100, 10, 1000, friends)
    TA_friends = analyze_trace(trace, len(friends))
    assert len(TA_friends) == len(friends)
    assert sorted(TA_friends) == sorted(friends)
Exemplo n.º 2
0
def test_trace_variable():
    # A random number of friends and random contacts
    friend_number = random.choice(range(1, 10))
    friends = random.sample(range(100), friend_number)

    trace = generate_trace(100, 10, 1000, friends)
    TA_friends = analyze_trace(trace, len(friends))
    assert len(TA_friends) == len(friends)
    assert sorted(TA_friends) == sorted(friends)
Exemplo n.º 3
0
def test_trace_static():
    # A fixed set and number of friends
    trace = generate_trace(100, 10, 1000, [1, 2, 3])
    friends = analyze_trace(trace, 3)
    assert len(friends) == 3
    assert sorted(friends) == [1, 2, 3]
Exemplo n.º 4
0
def test_trace_static():
    # A fixed set and number of friends
    trace = generate_trace(100, 10, 1000, [1, 2, 3])
    friends = analyze_trace(trace, 3)
    assert len(friends) == 3
    assert sorted(friends) == [1, 2, 3]