def should_generate_friend_of_friends_list_for_n_X_2_degree(): assert ['p1 p2 p3 p5', 'p2 p1 p3 p5', 'p3 p1 p2 p5', 'p5 p1 p2 p3', #output for line1 'p2 p4 p5 p6', 'p4 p2 p5 p6', #line2 output 'p5 p2 p4 p6', 'p6 p2 p4 p5' ] == untabify(link_combinations(tabify(['p1 p2 p3 p5', 'p2 p4 p5 p6'])))
def should_map_friends_at_degree_1(): assert tabify([ 'kim omid', 'omid kim', 'omid mick', 'mick omid', 'mick qux', 'qux mick', 'qux kim', 'kim qux' ]) == list( link_combinations( tabify(["kim omid", "omid mick", "mick qux", "qux kim"])))
def should_map_friends_at_degree_1(): assert tabify(['kim omid', 'omid kim', 'omid mick', 'mick omid', 'mick qux', 'qux mick', 'qux kim', 'kim qux']) == list(link_combinations(tabify(["kim omid", "omid mick", "mick qux", "qux kim"])))
def should_generate_friend_of_friends_list_for_n_X_2_degree(): assert [ 'p1 p2 p3 p5', 'p2 p1 p3 p5', 'p3 p1 p2 p5', 'p5 p1 p2 p3', #output for line1 'p2 p4 p5 p6', 'p4 p2 p5 p6', #line2 output 'p5 p2 p4 p6', 'p6 p2 p4 p5' ] == untabify(link_combinations(tabify(['p1 p2 p3 p5', 'p2 p4 p5 p6'])))