File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -119,12 +119,12 @@ async fn test_csv_upload() -> actix_web::Result<()> {
119
119
. insert_header ( ( "content-type" , "multipart/form-data; boundary=1234567890" ) )
120
120
. set_payload (
121
121
"--1234567890\r \n \
122
- Content-Disposition: form-data; name=\" prices_file \" ; filename=\" prices .csv\" \r \n \
122
+ Content-Disposition: form-data; name=\" people_file \" ; filename=\" people .csv\" \r \n \
123
123
Content-Type: text/csv\r \n \
124
124
\r \n \
125
- price,quantity \r \n \
126
- 1,5 \r \n \
127
- 2.5,4 \r \n \
125
+ name,age \r \n \
126
+ Ophir,29 \r \n \
127
+ Max,99 \r \n \
128
128
--1234567890--\r \n ",
129
129
)
130
130
. to_srv_request ( ) ;
@@ -134,8 +134,8 @@ async fn test_csv_upload() -> actix_web::Result<()> {
134
134
let body = test:: read_body ( resp) . await ;
135
135
let body_str = String :: from_utf8 ( body. to_vec ( ) ) . unwrap ( ) ;
136
136
assert ! (
137
- body_str. contains( "total: 15 " ) ,
138
- "{body_str}\n expected to contain: total: 15 "
137
+ body_str. contains( "Ophir is 29 years old " ) ,
138
+ "{body_str}\n expected to contain: Ophir is 29 years old "
139
139
) ;
140
140
Ok ( ( ) )
141
141
}
Original file line number Diff line number Diff line change 1
- create table bill (quantity text , price text );
2
- copy bill(quantity, price ) from ' prices_file ' with (format csv, header true);
1
+ create table people (name text , age text );
2
+ copy people(name, age ) from ' people_file ' with (format csv, header true);
3
3
select ' text' as component,
4
- ' total: ' || sum (cast(quantity as float) * cast(price as float)) as contents
5
- from bill ;
4
+ name || ' is ' || age || ' years old. ' as contents
5
+ from people ;
You can’t perform that action at this time.
0 commit comments