File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 25
25
import list_operation_status
26
26
import get_operation_status
27
27
import create_model
28
+ import delete_model
28
29
29
30
project_id = os .environ ['GCLOUD_PROJECT' ]
30
31
dataset_id = 'TRL3876092572857648864'
@@ -76,3 +77,14 @@ def test_create_model(capsys):
76
77
from google .cloud import automl
77
78
client = automl .AutoMlClient ()
78
79
client .transport ._operations_client .cancel_operation (operation_id )
80
+
81
+
82
+ @pytest .mark .slow
83
+ def test_delete_model (capsys ):
84
+ # As model creation can take many hours, instead try to delete a
85
+ # nonexistent model and confirm that the model was not found, but other
86
+ # elements of the request were valid.
87
+ delete_model .delete_model (project_id , 'TRL0000000000000000000' )
88
+ out , _ = capsys .readouterr ()
89
+ assert 'status = StatusCode.NOT_FOUND' in out
90
+ assert 'details = "The model does not exist."' in out
You can’t perform that action at this time.
0 commit comments