a *NaX@sdZddlZddlZddlZddlZddlmZmZdddddd d d d dd ddd dddd ddddddgZej ddZ ej ddZ ej ddZ ddZ ddZddZd d!Zd"d#Zejd$d%d&Zd'd(Zd)d*Zejd$d+d,ZdS)-z8 GitLab API: https://docs.gitlab.com/ce/api/groups.html N)GroupDescendantGroup GroupSubgroupz Bar Groupzfoo/barzA subgroup of Foo GrouppublicF0Z developerownerTz8http://gitlab.example.com/uploads/group/avatar/1/bar.jpgz(http://gitlab.example.com/groups/foo/bar{z2020-01-15T12:36:29.590Z)idnamepath descriptionZ visibilityZshare_with_group_lockZ!require_two_factor_authenticationZtwo_factor_grace_periodZproject_creation_levelZauto_devops_enabledZsubgroup_creation_levelZemails_disabledZmentions_disabledZ lfs_enabledZdefault_branch_protectionZ avatar_urlZweb_urlZrequest_access_enabledZ full_name full_pathZfile_template_project_idZ parent_idZ created_atccsdddd}tjddZ}|jtjd|dd d |jtjd |gdd d |jtjd |dd d |VWdn1sx0YdS) Nr rr )r r r F)Zassert_all_requests_are_firedz http://localhost/api/v4/groups/1application/jsonmethodurljson content_typestatuszhttp://localhost/api/v4/groups) responses RequestsMockaddGETPOST)contentrspsry/private/var/folders/js/6pj4vh5d4zd0k6bxv74qrbhr0000gr/T/pip-target-22xwyzbs/lib/python/tests/unit/objects/test_groups.py resp_groups*s0 r ccsNt2}|jtjtdtddd|VWdn1s@0YdS)Nz>http://localhost/api/v4/groups/1/(subgroups|descendant_groups)rrr)rrrrrecompilesubgroup_descgroup_content)rrrr%resp_list_subgroups_descendant_groupsGs  r$ccsHt,}|jtjd|ddd|VWdn1s:0YdS)Nz%http://localhost/api/v4/groups/importrr)rrrr)Zaccepted_contentrrrrresp_create_importVs r&cCsN|jd}t|tjjjs J|jdks.J|jdkscCs:|j}t|dtsJ|djtddks6JdSr;)descendant_groupsr=r)rr r#)r7r$r?rrr!test_list_group_descendant_groups~s r@z#GitLab API endpoint not implementedcCs$|j}||jdks JdSNfinished)r4r1refreshZ export_statusr6rrr test_refresh_group_export_statuss rDcCs0|j}|}t|ts J||ks,JdS)N)r4r1downloadr)bytes)r7r8Zbinary_contentr9rErrrtest_download_group_exports rGcCs$|jddd}|ddks JdS)Nfilez api-groupz API Groupr5r3)r'Z import_group)r.r& group_importrrrtest_import_groupsrJcCs$|j}||jdks JdSrA)Zimportsr(rCZ import_status)r7r rIrrr test_refresh_group_import_statuss rK)__doc__r!Zpytestrr*Zgitlab.v4.objectsrrr#Zfixturer r$r&r0r2r:r>r@markskiprDrGrJrKrrrrs^