File tree Expand file tree Collapse file tree 1 file changed +11
-13
lines changed
Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Original file line number Diff line number Diff line change 1+ import assert from 'assert' ;
12import {
23 CloudserverClient ,
34 PutDataInput ,
@@ -44,19 +45,16 @@ describe('CloudServer API Tests', () => {
4445 }
4546 } ) ;
4647
47- it ( 'should test GetObject' , async ( ) => {
48- try {
49- const getInput : GetObjectInput = {
50- Bucket : testConfig . bucketName ,
51- Key : testConfig . objectKey ,
52- RequestUids : '123' ,
53- } ;
54- const getCommand = new GetObjectCommand ( getInput ) ;
55- const getData = await client . send ( getCommand ) ;
56- console . log ( 'GetObject succeeded:' , getData ) ;
57- } catch ( err ) {
58- console . log ( 'GetObject failed:' , err ) ;
59- }
48+ it ( 'should test GetSingleObject' , async ( ) => {
49+ const getInput : GetObjectInput = {
50+ Bucket : testConfig . bucketName ,
51+ Key : testConfig . objectKey ,
52+ RequestUids : '123' ,
53+ } ;
54+ const getCommand = new GetObjectCommand ( getInput ) ;
55+ const getData = await client . send ( getCommand ) ;
56+ console . log ( 'GetObject succeeded:' , getData ) ;
57+ assert . equal ( await getData . Body . transformToString ( ) , 'Hey!!' ) ;
6058 } ) ;
6159
6260 it ( 'should test GetObjectList' , async ( ) => {
You can’t perform that action at this time.
0 commit comments