a *Na@s(dZddlZddlZddlZddlmZmZmZdZdZ dZ ede dd d Z e d Z e d eZejd dZejddZejddZejddZejddZddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Z d/d0Z!d1d2Z"d3d4Z#dS)5z GitLab API: https://docs.gitlab.com/ee/api/instance_level_ci_variables.html https://docs.gitlab.com/ee/api/project_level_variables.html https://docs.gitlab.com/ee/api/group_level_variables.html N) GroupVariableProjectVariableVariableZTEST_VARIABLE_1ZTEST_1ZTEST_2env_varFT)keyZ variable_typevalueZ protectedZmaskedzDhttp://localhost/api/v4/(((groups|projects)/1)|(admin/ci))/variableszEhttp://localhost/api/v4/(((groups|projects)/1)|(admin/ci))/variables/ccsJt.}|jtjttgddd|VWdn1s<0YdSNapplication/jsonmethodurljson content_typestatus) responses RequestsMockaddGET variables_urlvariable_contentrspsr|/private/var/folders/js/6pj4vh5d4zd0k6bxv74qrbhr0000gr/T/pip-target-22xwyzbs/lib/python/tests/unit/objects/test_variables.pyresp_list_variables"s rccsHt,}|jtjttddd|VWdn1s:0YdSr)rrrrvariables_key_urlrrrrrresp_get_variable/s rccsHt,}|jtjttddd|VWdn1s:0YdSr)rrrPOSTrrrrrrresp_create_variable<s rccsXtt}t|d<t,}|jtjt|ddd|VWdn1sJ0YdS)Nrr r r )dictr new_valuerrrPUTr)Zupdated_contentrrrrresp_update_variableIs r#ccsHt,}|jtjt|ddd|VWdn1s:0YdS)Nr r )rrrDELETEr) no_contentrrrrresp_delete_variableYs r'cCs@|j}t|tsJt|dts*J|djtkscCs2|jttd}t|ts J|jtks.JdSr2)r)r3rrr+r)r<rr0rrrtest_create_project_variablesr?cCs0|jjtdd}t|_||jtks,JdSr5r6)r<r#r0rrrtest_update_project_variablesr@cCs|jjtdd}|dSr5r9)r<r'r0rrrtest_delete_project_variablesrAcCs@|j}t|tsJt|dts*J|djtksr?r@rArCrDrErFrGrrrrsX