mirror of
https://github.com/sasjs/core.git
synced 2025-12-10 22:14:35 +00:00
fix: ensuring test passes for mfs_httpheader
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
|
|
||||||
%mfs_httpheader(Content-type,application/csv)
|
%mfs_httpheader(Content-Type,application/csv)
|
||||||
|
|
||||||
@param [in] header_name Name of the http header to set
|
@param [in] header_name Name of the http header to set
|
||||||
@param [in] header_value Value of the http header to set
|
@param [in] header_value Value of the http header to set
|
||||||
@@ -28,6 +28,7 @@
|
|||||||
%macro mfs_httpheader(header_name
|
%macro mfs_httpheader(header_name
|
||||||
,header_value
|
,header_value
|
||||||
)/*/STORE SOURCE*/;
|
)/*/STORE SOURCE*/;
|
||||||
|
%global sasjs_stpsrv_header_loc;
|
||||||
%local fref fid i;
|
%local fref fid i;
|
||||||
|
|
||||||
%if %sysfunc(filename(fref,&sasjs_stpsrv_header_loc)) ne 0 %then %do;
|
%if %sysfunc(filename(fref,&sasjs_stpsrv_header_loc)) ne 0 %then %do;
|
||||||
|
|||||||
@@ -9,11 +9,12 @@
|
|||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
%let orig_sasjs_stpsrv_header_loc=&sasjs_stpsrv_header_loc;
|
||||||
%let sasjs_stpsrv_header_loc=%sysfunc(pathname(work))/header.txt;
|
%let sasjs_stpsrv_header_loc=%sysfunc(pathname(work))/header.txt;
|
||||||
|
|
||||||
%mp_assertscope(SNAPSHOT)
|
%mp_assertscope(SNAPSHOT)
|
||||||
%mfs_httpheader(Content-type,application/csv)
|
%mfs_httpheader(Content-Type,application/csv)
|
||||||
%mp_assertscope(COMPARE)
|
%mp_assertscope(COMPARE,ignorelist=sasjs_stpsrv_header_loc)
|
||||||
|
|
||||||
data _null_;
|
data _null_;
|
||||||
infile "&sasjs_stpsrv_header_loc";
|
infile "&sasjs_stpsrv_header_loc";
|
||||||
@@ -27,12 +28,12 @@ run;
|
|||||||
outds=work.test_results
|
outds=work.test_results
|
||||||
)
|
)
|
||||||
%mp_assert(
|
%mp_assert(
|
||||||
iftrue=("&test1"="Content-type: application/csv"),
|
iftrue=("&test1"="Content-Type: application/csv"),
|
||||||
desc=Checking line was created,
|
desc=Checking line was created,
|
||||||
outds=work.test_results
|
outds=work.test_results
|
||||||
)
|
)
|
||||||
|
|
||||||
%mfs_httpheader(Content-type,application/text)
|
%mfs_httpheader(Content-Type,application/text)
|
||||||
%let test2=0;
|
%let test2=0;
|
||||||
data _null_;
|
data _null_;
|
||||||
infile "&sasjs_stpsrv_header_loc";
|
infile "&sasjs_stpsrv_header_loc";
|
||||||
@@ -46,12 +47,11 @@ run;
|
|||||||
outds=work.test_results
|
outds=work.test_results
|
||||||
)
|
)
|
||||||
%mp_assert(
|
%mp_assert(
|
||||||
iftrue=("&test2"="Content-type: application/text"),
|
iftrue=("&test2"="Content-Type: application/text"),
|
||||||
desc=Checking line was created,
|
desc=Checking line was created,
|
||||||
outds=work.test_results
|
outds=work.test_results
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
/* reset header so the test will pass */
|
/* reset header so the test will pass */
|
||||||
|
%let sasjs_stpsrv_header_loc=&orig_sasjs_stpsrv_header_loc;
|
||||||
%mfs_httpheader(Content-type,application/json)
|
|
||||||
Reference in New Issue
Block a user