mirror of
https://github.com/sasjs/core.git
synced 2026-01-16 04:50:05 +00:00
fix: tests with new APIs are now passing
This commit is contained in:
43
all.sas
43
all.sas
@@ -20424,7 +20424,7 @@ options &optval;
|
|||||||
@param [in] group= (0) Set to a group name to filter members for that group
|
@param [in] group= (0) Set to a group name to filter members for that group
|
||||||
@param [out] outds= (work.ms_getusers) This output dataset will contain the
|
@param [out] outds= (work.ms_getusers) This output dataset will contain the
|
||||||
list of user accounts. Format:
|
list of user accounts. Format:
|
||||||
|DISPLAYNAME:$18.|USERNAME:$10.|ID:best.|
|
|DISPLAYNAME:$60.|USERNAME:$30.|ID:best.|
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
|`Super Admin `|`secretuser `|`1`|
|
|`Super Admin `|`secretuser `|`1`|
|
||||||
|`Sabir Hassan`|`sabir`|`2`|
|
|`Sabir Hassan`|`sabir`|`2`|
|
||||||
@@ -20437,9 +20437,7 @@ options &optval;
|
|||||||
<h4> SAS Macros </h4>
|
<h4> SAS Macros </h4>
|
||||||
@li mf_getuniquefileref.sas
|
@li mf_getuniquefileref.sas
|
||||||
@li mf_getuniquelibref.sas
|
@li mf_getuniquelibref.sas
|
||||||
@li mf_getuniquename.sas
|
|
||||||
@li mp_abort.sas
|
@li mp_abort.sas
|
||||||
@li ms_getgroups.sas
|
|
||||||
|
|
||||||
<h4> Related Files </h4>
|
<h4> Related Files </h4>
|
||||||
@li ms_createuser.sas
|
@li ms_createuser.sas
|
||||||
@@ -20460,7 +20458,7 @@ options &optval;
|
|||||||
,msg=%str(syscc=&syscc on macro entry)
|
,msg=%str(syscc=&syscc on macro entry)
|
||||||
)
|
)
|
||||||
|
|
||||||
%local fref0 fref1 libref optval rc msg;
|
%local fref0 fref1 libref optval rc msg url;
|
||||||
%let fref0=%mf_getuniquefileref();
|
%let fref0=%mf_getuniquefileref();
|
||||||
%let fref1=%mf_getuniquefileref();
|
%let fref1=%mf_getuniquefileref();
|
||||||
%let libref=%mf_getuniquelibref();
|
%let libref=%mf_getuniquelibref();
|
||||||
@@ -20484,35 +20482,18 @@ run;
|
|||||||
put _infile_;
|
put _infile_;
|
||||||
run;
|
run;
|
||||||
%end;
|
%end;
|
||||||
%if "&group"="0" %then %do;
|
|
||||||
proc http method='GET' headerin=&fref0 out=&fref1
|
|
||||||
url="&_sasjs_apiserverurl/SASjsApi/user";
|
|
||||||
%if &mdebug=1 %then %do;
|
|
||||||
debug level=1;
|
|
||||||
%end;
|
|
||||||
run;
|
|
||||||
%end;
|
|
||||||
%else %do;
|
|
||||||
/* currently we only have an API to fetch by group ID */
|
|
||||||
/* so first fetch all the groups, and grab the id */
|
|
||||||
%local groupid ds1;
|
|
||||||
%let ds1=%mf_getuniquename(prefix=groups);
|
|
||||||
%ms_getgroups(outds=&ds1)
|
|
||||||
data _null_;
|
|
||||||
set &ds1;
|
|
||||||
where name="&group";
|
|
||||||
call symputx('groupid',groupid,'l');
|
|
||||||
run;
|
|
||||||
|
|
||||||
proc http method='GET' headerin=&fref0 out=&fref1
|
%if "&group"="0" %then %let url=/SASjsApi/user;
|
||||||
url="&_sasjs_apiserverurl/SASjsApi/group/&groupid";
|
%else %let url=/SASjsApi/group/by/groupname/&group;
|
||||||
%if &mdebug=1 %then %do;
|
|
||||||
debug level=1;
|
|
||||||
%put &=groupid;
|
|
||||||
%end;
|
|
||||||
run;
|
|
||||||
|
|
||||||
|
|
||||||
|
proc http method='GET' headerin=&fref0 out=&fref1
|
||||||
|
url="&_sasjs_apiserverurl.&url";
|
||||||
|
%if &mdebug=1 %then %do;
|
||||||
|
debug level=1;
|
||||||
%end;
|
%end;
|
||||||
|
run;
|
||||||
|
|
||||||
|
|
||||||
%mp_abort(
|
%mp_abort(
|
||||||
iftrue=(&syscc ne 0)
|
iftrue=(&syscc ne 0)
|
||||||
@@ -20524,12 +20505,14 @@ libname &libref JSON fileref=&fref1;
|
|||||||
|
|
||||||
%if "&group"="0" %then %do;
|
%if "&group"="0" %then %do;
|
||||||
data &outds;
|
data &outds;
|
||||||
|
length DISPLAYNAME $60 USERNAME:$30 ID 8;
|
||||||
set &libref..root;
|
set &libref..root;
|
||||||
drop ordinal_root;
|
drop ordinal_root;
|
||||||
run;
|
run;
|
||||||
%end;
|
%end;
|
||||||
%else %do;
|
%else %do;
|
||||||
data &outds;
|
data &outds;
|
||||||
|
length DISPLAYNAME $60 USERNAME:$30 ID 8;
|
||||||
set &libref..users;
|
set &libref..users;
|
||||||
drop ordinal_root ordinal_users;
|
drop ordinal_root ordinal_users;
|
||||||
run;
|
run;
|
||||||
|
|||||||
@@ -67,7 +67,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "server",
|
"name": "server",
|
||||||
"serverUrl": "https://sas.4gl.io:5001",
|
"serverUrl": "https://sas.4gl.io",
|
||||||
"serverType": "SASJS",
|
"serverType": "SASJS",
|
||||||
"httpsAgentOptions": {
|
"httpsAgentOptions": {
|
||||||
"allowInsecureRequests": false
|
"allowInsecureRequests": false
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
@param [in] group= (0) Set to a group name to filter members for that group
|
@param [in] group= (0) Set to a group name to filter members for that group
|
||||||
@param [out] outds= (work.ms_getusers) This output dataset will contain the
|
@param [out] outds= (work.ms_getusers) This output dataset will contain the
|
||||||
list of user accounts. Format:
|
list of user accounts. Format:
|
||||||
|DISPLAYNAME:$18.|USERNAME:$10.|ID:best.|
|
|DISPLAYNAME:$60.|USERNAME:$30.|ID:best.|
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
|`Super Admin `|`secretuser `|`1`|
|
|`Super Admin `|`secretuser `|`1`|
|
||||||
|`Sabir Hassan`|`sabir`|`2`|
|
|`Sabir Hassan`|`sabir`|`2`|
|
||||||
@@ -29,9 +29,7 @@
|
|||||||
<h4> SAS Macros </h4>
|
<h4> SAS Macros </h4>
|
||||||
@li mf_getuniquefileref.sas
|
@li mf_getuniquefileref.sas
|
||||||
@li mf_getuniquelibref.sas
|
@li mf_getuniquelibref.sas
|
||||||
@li mf_getuniquename.sas
|
|
||||||
@li mp_abort.sas
|
@li mp_abort.sas
|
||||||
@li ms_getgroups.sas
|
|
||||||
|
|
||||||
<h4> Related Files </h4>
|
<h4> Related Files </h4>
|
||||||
@li ms_createuser.sas
|
@li ms_createuser.sas
|
||||||
@@ -52,7 +50,7 @@
|
|||||||
,msg=%str(syscc=&syscc on macro entry)
|
,msg=%str(syscc=&syscc on macro entry)
|
||||||
)
|
)
|
||||||
|
|
||||||
%local fref0 fref1 libref optval rc msg;
|
%local fref0 fref1 libref optval rc msg url;
|
||||||
%let fref0=%mf_getuniquefileref();
|
%let fref0=%mf_getuniquefileref();
|
||||||
%let fref1=%mf_getuniquefileref();
|
%let fref1=%mf_getuniquefileref();
|
||||||
%let libref=%mf_getuniquelibref();
|
%let libref=%mf_getuniquelibref();
|
||||||
@@ -76,35 +74,18 @@ run;
|
|||||||
put _infile_;
|
put _infile_;
|
||||||
run;
|
run;
|
||||||
%end;
|
%end;
|
||||||
%if "&group"="0" %then %do;
|
|
||||||
proc http method='GET' headerin=&fref0 out=&fref1
|
|
||||||
url="&_sasjs_apiserverurl/SASjsApi/user";
|
|
||||||
%if &mdebug=1 %then %do;
|
|
||||||
debug level=1;
|
|
||||||
%end;
|
|
||||||
run;
|
|
||||||
%end;
|
|
||||||
%else %do;
|
|
||||||
/* currently we only have an API to fetch by group ID */
|
|
||||||
/* so first fetch all the groups, and grab the id */
|
|
||||||
%local groupid ds1;
|
|
||||||
%let ds1=%mf_getuniquename(prefix=groups);
|
|
||||||
%ms_getgroups(outds=&ds1)
|
|
||||||
data _null_;
|
|
||||||
set &ds1;
|
|
||||||
where name="&group";
|
|
||||||
call symputx('groupid',groupid,'l');
|
|
||||||
run;
|
|
||||||
|
|
||||||
proc http method='GET' headerin=&fref0 out=&fref1
|
%if "&group"="0" %then %let url=/SASjsApi/user;
|
||||||
url="&_sasjs_apiserverurl/SASjsApi/group/&groupid";
|
%else %let url=/SASjsApi/group/by/groupname/&group;
|
||||||
%if &mdebug=1 %then %do;
|
|
||||||
debug level=1;
|
|
||||||
%put &=groupid;
|
|
||||||
%end;
|
|
||||||
run;
|
|
||||||
|
|
||||||
|
|
||||||
|
proc http method='GET' headerin=&fref0 out=&fref1
|
||||||
|
url="&_sasjs_apiserverurl.&url";
|
||||||
|
%if &mdebug=1 %then %do;
|
||||||
|
debug level=1;
|
||||||
%end;
|
%end;
|
||||||
|
run;
|
||||||
|
|
||||||
|
|
||||||
%mp_abort(
|
%mp_abort(
|
||||||
iftrue=(&syscc ne 0)
|
iftrue=(&syscc ne 0)
|
||||||
@@ -116,12 +97,14 @@ libname &libref JSON fileref=&fref1;
|
|||||||
|
|
||||||
%if "&group"="0" %then %do;
|
%if "&group"="0" %then %do;
|
||||||
data &outds;
|
data &outds;
|
||||||
|
length DISPLAYNAME $60 USERNAME:$30 ID 8;
|
||||||
set &libref..root;
|
set &libref..root;
|
||||||
drop ordinal_root;
|
drop ordinal_root;
|
||||||
run;
|
run;
|
||||||
%end;
|
%end;
|
||||||
%else %do;
|
%else %do;
|
||||||
data &outds;
|
data &outds;
|
||||||
|
length DISPLAYNAME $60 USERNAME:$30 ID 8;
|
||||||
set &libref..users;
|
set &libref..users;
|
||||||
drop ordinal_root ordinal_users;
|
drop ordinal_root ordinal_users;
|
||||||
run;
|
run;
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ run;
|
|||||||
%let checkid=0;
|
%let checkid=0;
|
||||||
data _null_;
|
data _null_;
|
||||||
set work.test2;
|
set work.test2;
|
||||||
where name="&group";
|
where upcase(name)="%upcase(&group)";
|
||||||
call symputx('checkid',groupid);
|
call symputx('checkid',groupid);
|
||||||
run;
|
run;
|
||||||
%mp_assert(
|
%mp_assert(
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ run;
|
|||||||
data _null_;
|
data _null_;
|
||||||
set work.test2;
|
set work.test2;
|
||||||
if _n_<20 then putlog (_all_)(=);
|
if _n_<20 then putlog (_all_)(=);
|
||||||
if username="&user";
|
if upcase(username)="%upcase(&user)";
|
||||||
call symputx('checkid',id);
|
call symputx('checkid',id);
|
||||||
run;
|
run;
|
||||||
%mp_assert(
|
%mp_assert(
|
||||||
|
|||||||
@@ -28,9 +28,12 @@
|
|||||||
%mp_assertdsobs(work.test1,test=ATLEAST 1)
|
%mp_assertdsobs(work.test1,test=ATLEAST 1)
|
||||||
|
|
||||||
%let test2=0;
|
%let test2=0;
|
||||||
|
%put &=group;
|
||||||
data _null_;
|
data _null_;
|
||||||
set work.test1;
|
set work.test1;
|
||||||
if groupname="&group" then do;
|
putlog (_all_)(=);
|
||||||
|
if upcase(name)="%upcase(&group)" then do;
|
||||||
|
putlog "&group found!";
|
||||||
call symputx('test2',1);
|
call symputx('test2',1);
|
||||||
call symputx('gid',groupid); /* used in next test */
|
call symputx('gid',groupid); /* used in next test */
|
||||||
end;
|
end;
|
||||||
|
|||||||
Reference in New Issue
Block a user