@@ -22,12 +22,14 @@ describe('discovery_integration', function() {
22
22
let configuration_id ;
23
23
let collection_id ;
24
24
let collection_id2 ;
25
+ let japanese_collection_id ;
25
26
26
27
before ( function ( ) {
27
28
environment_id = auth . discovery . environment_id ;
28
29
configuration_id = auth . discovery . configuration_id ;
29
30
collection_id = auth . discovery . collection_id ;
30
31
collection_id2 = auth . discovery . collection_id_2 ;
32
+ japanese_collection_id = auth . discovery . japanese_collection_id ;
31
33
32
34
nock . enableNetConnect ( ) ;
33
35
discovery = new DiscoveryV1 (
@@ -481,4 +483,55 @@ describe('discovery_integration', function() {
481
483
} ) ;
482
484
} ) ;
483
485
} ) ;
486
+
487
+ describe ( 'tokenization dictionary tests @slow' , function ( ) {
488
+ it ( 'should createTokenizationDictionary' , function ( done ) {
489
+ const params = {
490
+ environment_id,
491
+ collection_id : japanese_collection_id ,
492
+ tokenization_rules : [
493
+ {
494
+ text : 'すしネコ' ,
495
+ tokens : [ 'すし' , 'ネコ' ] ,
496
+ readings : [ '寿司' , 'ネコ' ] ,
497
+ part_of_speech : 'カスタム名詞' ,
498
+ } ,
499
+ ] ,
500
+ } ;
501
+
502
+ discovery . createTokenizationDictionary ( params , ( err , res ) => {
503
+ assert . ifError ( err ) ;
504
+ assert ( res . status ) ;
505
+ assert ( res . type ) ;
506
+ done ( ) ;
507
+ } ) ;
508
+ } ) ;
509
+
510
+ it ( 'should getTokenizationDictionaryStatus' , function ( done ) {
511
+ const params = {
512
+ environment_id,
513
+ collection_id : japanese_collection_id ,
514
+ } ;
515
+
516
+ discovery . getTokenizationDictionaryStatus ( params , ( err , res ) => {
517
+ assert . ifError ( err ) ;
518
+ assert ( res . status ) ;
519
+ assert ( res . type ) ;
520
+ done ( ) ;
521
+ } ) ;
522
+ } ) ;
523
+
524
+ it ( 'should deleteTokenizationDictionary' , function ( done ) {
525
+ const params = {
526
+ environment_id,
527
+ collection_id : japanese_collection_id ,
528
+ } ;
529
+
530
+ discovery . deleteTokenizationDictionary ( params , ( err , res ) => {
531
+ assert . ifError ( err ) ;
532
+ assert . equal ( res , '' ) ;
533
+ done ( ) ;
534
+ } ) ;
535
+ } ) ;
536
+ } ) ;
484
537
} ) ;
0 commit comments