a *Na@sdZddlZddlZddlmZmZmZejddZejddZ ejdd Z ejd d Z ejd d Z ejddZ ejddZddZddZddZddZddZddZddZdS) z7 GitLab API: https://docs.gitlab.com/ce/api/users.html N)UserUserMembership UserStatusccsXdddddd}t,}|jtjd|dd d |VWdn1sJ0YdS) Nnamepasswordusernameemail)ridrrr zhttp://localhost/api/v4/users/1application/jsonmethodurljson content_typestatus responses RequestsMockaddGETcontentrspsrx/private/var/folders/js/6pj4vh5d4zd0k6bxv74qrbhr0000gr/T/pip-target-22xwyzbs/lib/python/tests/unit/objects/test_users.py resp_get_user s rccsdddddddddddg}t,}|jtjd |d d d |VWdn1sV0YdS) Nrz Project oneProjectZ20)Z source_idZ source_name source_typeZ access_levelz Group threeZ Namespacez+http://localhost/api/v4/users/1/membershipsr r r rrrrrresp_get_user_membershipss( r!ccsbtjddB}|jtjdiddd|jtjdiddd|VWdn1sT0YdS)NF)Zassert_all_requests_are_firedz(http://localhost/api/v4/users/1/activater r z*http://localhost/api/v4/users/1/deactivaterrrPOST)rrrr resp_activate;s r%ccsTdddd}t,}|jtjd|ddd|VWdn1sF0YdS) Ntestz

Message

thumbsup)messageZ message_htmlemojiz&http://localhost/api/v4/users/1/statusr r r rrrrrresp_get_user_statusOs r*ccsHt,}|jtjd|ddd|VWdn1s:0YdS)Nz8http://localhost/api/v4/users/1/identities/test_providerr r )rrrDELETE) no_contentrrrrresp_delete_user_identitybs r.ccspddddddd}tB}|jtjd|d d d |jtjd |d d d |VWdn1sb0YdS) NrZ john_smithz John Smithactivez4http://localhost:3000/uploads/user/avatar/1/cd8.jpegz http://localhost:3000/john_smith)r rrstate avatar_urlweb_urlz&http://localhost/api/v4/users/1/followr r"r z(http://localhost/api/v4/users/1/unfollowr#)userrrrrresp_follow_unfollowos. r4ccsddddddddd d dd d dg}tB}|jtjd |ddd|jtjd|ddd|VWdn1st0YdS)NzLennie Donnellyzevette.kilbackr/zQhttps://www.gravatar.com/avatar/7955171a55ac4997ed81e5976287890a?s=80&d=identiconz$http://127.0.0.1:3000/evette.kilback)r rrr0r1r2zSerena BradtkeZcammyzQhttps://www.gravatar.com/avatar/a2daad869a7b60d3090b7b9bef4baf57?s=80&d=identiconzhttp://127.0.0.1:3000/cammyz)http://localhost/api/v4/users/1/followersr r r z)http://localhost/api/v4/users/1/followingrrrrrresp_followers_followings>  r7cCs:|jd}t|tsJ|jdks(J|jdks6JdS)Nrr)Zusersget isinstancerrr )glrr3rrr test_get_users r;cCs2|j}t|dtsJ|djdks.JdS)Nrr) membershipslistr9rr)r3r!r<rrrtest_user_membershipss r>cCs8|j}t|tsJ|jdks&J|jdks4JdS)Nr&r')rr8r9rr(r))r3r*rrrrtest_user_statuss r?cCs||dSN)activateZ deactivate)r3r%rrrtest_user_activate_deactivatesrBcCs|jddS)NZ test_provider)Zidentityprovidersdelete)r3r.rrrtest_delete_user_identitysrDcCs||dSr@)followZunfollow)r3r4rrrtest_user_follow_unfollowsrFcCs`|j}|j}t|dts&J|djdks8Jt|dtsJJ|djdks\JdS)Nrr5rr6)Zfollowers_usersr=Zfollowing_usersr9rr )r3r7Z followersZ followingsrrrtest_list_followerss   rG)__doc__ZpytestrZgitlab.v4.objectsrrrZfixturerr!r%r*r.r4r7r;r>r?rBrDrFrGrrrrs0       %