9
9
10
10
import rasa .model
11
11
12
- from rasa .train import train
12
+ from rasa .train import train_core , train_nlu , train
13
13
from tests .core .test_model import _fingerprint
14
14
15
15
@@ -72,11 +72,13 @@ def test_train_temp_files(
72
72
default_nlu_data : Text ,
73
73
):
74
74
monkeypatch .setattr (tempfile , "tempdir" , tmp_path )
75
+ output = "test_train_temp_files_models"
75
76
76
77
train (
77
78
default_domain_path ,
78
79
default_stack_config ,
79
80
[default_stories_file , default_nlu_data ],
81
+ output = output ,
80
82
force_training = True ,
81
83
)
82
84
@@ -89,6 +91,45 @@ def test_train_temp_files(
89
91
default_domain_path ,
90
92
default_stack_config ,
91
93
[default_stories_file , default_nlu_data ],
94
+ output = output ,
95
+ )
96
+
97
+ assert count_temp_rasa_files (tempfile .tempdir ) == 0
98
+
99
+
100
+ def test_train_core_temp_files (
101
+ tmp_path : Text ,
102
+ monkeypatch : MonkeyPatch ,
103
+ default_domain_path : Text ,
104
+ default_stories_file : Text ,
105
+ default_stack_config : Text ,
106
+ ):
107
+ monkeypatch .setattr (tempfile , "tempdir" , tmp_path )
108
+
109
+ train_core (
110
+ default_domain_path ,
111
+ default_stack_config ,
112
+ default_stories_file ,
113
+ output = "test_train_core_temp_files_models" ,
114
+ )
115
+
116
+ assert count_temp_rasa_files (tempfile .tempdir ) == 0
117
+
118
+
119
+ def test_train_nlu_temp_files (
120
+ tmp_path : Text ,
121
+ monkeypatch : MonkeyPatch ,
122
+ default_domain_path : Text ,
123
+ default_stories_file : Text ,
124
+ default_stack_config : Text ,
125
+ default_nlu_data : Text ,
126
+ ):
127
+ monkeypatch .setattr (tempfile , "tempdir" , tmp_path )
128
+
129
+ train_nlu (
130
+ default_stack_config ,
131
+ default_nlu_data ,
132
+ output = "test_train_nlu_temp_files_models" ,
92
133
)
93
134
94
135
assert count_temp_rasa_files (tempfile .tempdir ) == 0
0 commit comments