def test_bi_direction_out(): uid1 = ROWS[0][2] # these users are not connected to uid1 uid6 = 'crap' user.enroll(uid6,uid6,uid6,uid6) uid7 = 'crap2' user.enroll(uid7,uid7,uid7,uid7) connect.outta_my_face(uid6,uid7) assert_true(actions.is_outta_my_face(uid6, uid7)) assert_true(actions.is_in_my_face(uid7, uid6)) # inverse test assert_false(actions.is_outta_my_face(uid7, uid6)) assert_false(actions.is_in_my_face(uid6, uid7)) # finally, test to make sure these users aren't connected to uid1 assert_false(actions.is_outta_my_face(uid1, uid6)) assert_false(actions.is_outta_my_face(uid1, uid7)) assert_false(actions.is_in_my_face(uid1, uid6)) assert_false(actions.is_in_my_face(uid1, uid7))
def test_second_connection(): """ test connected, not connected users """ # these users are connected to uid1 uid1 = ROWS[0][2] uid2 = ROWS[1][2] uid3 = ROWS[2][2] uid4 = ROWS[3][2] assert_true(actions.is_outta_my_face(uid1, uid1)) connect.outta_my_face(uid1, uid2) assert_true(actions.is_outta_my_face(uid1, uid2)) connect.outta_my_face(uid2, uid3) assert_true(actions.is_outta_my_face(uid2, uid3)) assert_true(actions.is_outta_my_face(uid1, uid3)) connect.outta_my_face(uid3, uid4) assert_true(actions.is_outta_my_face(uid3, uid4)) assert_true(actions.is_outta_my_face(uid2, uid4)) assert_true(actions.is_outta_my_face(uid1, uid4))
def test_direct_connection(): uid1 = ROWS[0][2] uid2 = ROWS[1][2] connect.outta_my_face(uid1, uid2) assert_true(actions.is_outta_my_face(uid1, uid2))