@@ -32,8 +32,8 @@ var path = require('path');
3232var assert = require ( 'assert' ) ;
3333const localPath = "../TestData/" ;
3434
35- describe ( 'CellsWorkbook_GetPageCountRequest ' , function ( ) {
36- it ( 'should call CellsWorkbook_GetPageCountRequest successfully' , function ( ) {
35+ describe ( 'cellsWorkbookPostDigitalSignature ' , function ( ) {
36+ it ( 'should call cellsWorkbookPostDigitalSignature successfully' , function ( ) {
3737 const cellsApi = BaseTest . initializeCellsApi ( ) ;
3838 const filename = "Book1.xlsx" ;
3939 var data = fs . createReadStream ( localPath + filename ) ;
@@ -43,55 +43,29 @@ describe('CellsWorkbook_GetPageCountRequest', function () {
4343
4444 return cellsApi . uploadFile ( req )
4545 . then ( ( result ) => {
46- expect ( result . body . uploaded . length ) . greaterThan ( 0 ) ;
47- const filename = "Book1.xlsx" ;
48- var req = new model . CellsWorkbook_GetPageCountRequest ( ) ;
49- req . folder = "Temp" ;
50- req . name = filename ;
46+ const pfxfilename = "roywang.pfx" ;
47+ var data1 = fs . createReadStream ( localPath + pfxfilename ) ;
48+ var req1 = new model . UploadFileRequest ( ) ;
49+ req1 . path = "Temp/" + pfxfilename ;
50+ req1 . file = data1 ;
5151
52- return cellsApi . cellsWorkbookGetPageCount ( req )
52+ return cellsApi . uploadFile ( req1 )
5353 . then ( ( result ) => {
54- expect ( result . body ) . to . greaterThan ( 0 ) ;
54+ expect ( result . body . uploaded . length ) . greaterThan ( 0 ) ;
55+ const filename = "Book1.xlsx" ;
56+ const pfxfilename = "roywang.pfx" ;
57+ var req2 = new model . CellsWorkbook_PostDigitalSignatureRequest ( ) ;
58+ req2 . digitalsignaturefile = "Temp/" + pfxfilename ;
59+ req2 . folder = "Temp" ;
60+ req2 . password = "123456" ;
61+ req2 . name = filename ;
62+
63+ return cellsApi . cellsWorkbookPostDigitalSignature ( req2 )
64+ . then ( ( result ) => {
65+ expect ( result . response . statusCode ) . to . equal ( 200 ) ;
66+ } ) ;
5567 } ) ;
5668 } ) ;
57- } ) ;
58-
59- // it('should call cellsWorkbookPutConvertWorkbook successfully', function() {
60- // const cellsApi = BaseTest.initializeCellsApi();
61- // const filename = "Book1.xlsx";
62-
63- // var req = new model.CellsWorkbook_PutConvertWorkbookRequest({
64- // file : fs.createReadStream(localPath + filename),
65- // format : "pdf",
66- // });
67-
68- // return cellsApi.cellsWorkbookPutConvertWorkbook(req)
69- // .then((result) => {
70- // // console.log(result);
71- // fs.writeFile('test.pdf',result['body'],'binary', err => {
72- // if (err) {
73- // console.error(err);
74- // }
75- // });
76- // });
77- // });
78- // it('should call down file successfully', function() {
79- // const cellsApi = BaseTest.initializeCellsApi();
80- // const filename = "Book1.xlsx";
81-
82- // var req = new model.DownloadFileRequest({
83- // path:'CellsTests/Book1.xlsx',
84- // storageName:'Cells',
85- // });
86-
87- // return cellsApi.downloadFile(req)
88- // .then((result) => {
89- // // console.log(result);
90- // fs.writeFile('Book1.xlsx',result['body'],'binary', err => {
91- // if (err) {
92- // console.error(err);
93- // }
94- // }) ;
95- // });
96- // });
69+ } ) ;
9770} ) ;
71+
0 commit comments