@@ -386,7 +386,8 @@ def test_create_example():
386386 example = service .create_example (
387387 workspace_id = 'boguswid' ,
388388 intent = 'pizza_order' ,
389- text = 'Gimme a pizza with pepperoni' )
389+ text = 'Gimme a pizza with pepperoni' ,
390+ mentions = [{'entity' : 'xxx' , 'location' : [0 , 1 ]}])
390391 assert len (responses .calls ) == 1
391392 assert responses .calls [0 ].request .url .startswith (url )
392393 assert example == response
@@ -507,7 +508,8 @@ def test_update_example():
507508 workspace_id = 'boguswid' ,
508509 intent = 'pizza_order' ,
509510 text = 'Gimme a pizza with pepperoni' ,
510- new_text = 'Gimme a pizza with pepperoni' )
511+ new_text = 'Gimme a pizza with pepperoni' ,
512+ new_mentions = [{'entity' : 'xxx' , 'location' : [0 , 1 ]}])
511513 assert len (responses .calls ) == 1
512514 assert responses .calls [0 ].request .url .startswith (url )
513515 assert example == response
@@ -1307,7 +1309,8 @@ def test_create_workspace():
13071309 service = watson_developer_cloud .ConversationV1 (
13081310 username = 'username' , password = 'password' , version = '2017-02-03' )
13091311 workspace = service .create_workspace (
1310- name = 'Pizza app' , description = 'Pizza app' , language = 'en' , metadata = {})
1312+ name = 'Pizza app' , description = 'Pizza app' , language = 'en' , metadata = {},
1313+ system_settings = {'tooling' : {'store_generic_responses' : True , 'disambiguation' : {'prompt' : 'Hello world' , 'enabled' : True }}})
13111314 assert len (responses .calls ) == 1
13121315 assert responses .calls [0 ].request .url .startswith (url )
13131316 assert workspace == response
@@ -1427,7 +1430,8 @@ def test_update_workspace():
14271430 name = 'Pizza app' ,
14281431 description = 'Pizza app' ,
14291432 language = 'en' ,
1430- metadata = {})
1433+ metadata = {},
1434+ system_settings = {'tooling' : {'store_generic_responses' : True , 'disambiguation' : {'prompt' : 'Hello world' , 'enabled' : True }}})
14311435 assert len (responses .calls ) == 1
14321436 assert responses .calls [0 ].request .url .startswith (url )
14331437 assert workspace == response
@@ -1467,7 +1471,7 @@ def test_dialog_nodes():
14671471
14681472 conversation = watson_developer_cloud .ConversationV1 ('2017-05-26' , username = "username" , password = "password" )
14691473
1470- conversation .create_dialog_node ('id' , 'location-done' )
1474+ conversation .create_dialog_node ('id' , 'location-done' , user_label = 'xxx' )
14711475 assert responses .calls [0 ].response .json ()['application/json' ]['dialog_node' ] == 'location-done'
14721476
14731477 conversation .delete_dialog_node ('id' , 'location-done' )
@@ -1496,3 +1500,19 @@ def test_delete_user_data():
14961500 response = conversation .delete_user_data ('id' )
14971501 assert response is None
14981502 assert len (responses .calls ) == 1
1503+
1504+ @responses .activate
1505+ def test_list_mentions ():
1506+ url = 'https://gateway.watsonplatform.net/conversation/api/v1/workspaces/workspace_id/entities/entity1/mentions'
1507+ responses .add (
1508+ responses .GET ,
1509+ url ,
1510+ body = '[{"entity": "xxx"}]' ,
1511+ status = 200 ,
1512+ content_type = 'application_json' )
1513+
1514+ conversation = watson_developer_cloud .ConversationV1 ('2017-05-26' , username = "username" , password = "password" )
1515+
1516+ response = conversation .list_mentions ('workspace_id' , 'entity1' )
1517+ assert response == [{"entity" : "xxx" }]
1518+ assert len (responses .calls ) == 1
0 commit comments