18
18
import rasa .utils .io as io_utils
19
19
20
20
21
- def test_train (run_in_default_project : Callable [..., RunResult ]):
21
+ def test_train (run_in_default_project_without_models : Callable [..., RunResult ]):
22
22
temp_dir = os .getcwd ()
23
23
24
- run_in_default_project (
24
+ run_in_default_project_without_models (
25
25
"train" ,
26
26
"-c" ,
27
27
"config.yml" ,
@@ -48,10 +48,12 @@ def test_train(run_in_default_project: Callable[..., RunResult]):
48
48
)
49
49
50
50
51
- def test_train_persist_nlu_data (run_in_default_project : Callable [..., RunResult ]):
51
+ def test_train_persist_nlu_data (
52
+ run_in_default_project_without_models : Callable [..., RunResult ]
53
+ ):
52
54
temp_dir = os .getcwd ()
53
55
54
- run_in_default_project (
56
+ run_in_default_project_without_models (
55
57
"train" ,
56
58
"-c" ,
57
59
"config.yml" ,
@@ -79,7 +81,9 @@ def test_train_persist_nlu_data(run_in_default_project: Callable[..., RunResult]
79
81
)
80
82
81
83
82
- def test_train_core_compare (run_in_default_project : Callable [..., RunResult ]):
84
+ def test_train_core_compare (
85
+ run_in_default_project_without_models : Callable [..., RunResult ]
86
+ ):
83
87
temp_dir = os .getcwd ()
84
88
85
89
io_utils .write_yaml_file (
@@ -100,7 +104,7 @@ def test_train_core_compare(run_in_default_project: Callable[..., RunResult]):
100
104
"config_2.yml" ,
101
105
)
102
106
103
- run_in_default_project (
107
+ run_in_default_project_without_models (
104
108
"train" ,
105
109
"core" ,
106
110
"-c" ,
@@ -132,11 +136,11 @@ def test_train_core_compare(run_in_default_project: Callable[..., RunResult]):
132
136
133
137
134
138
def test_train_no_domain_exists (
135
- run_in_default_project : Callable [..., RunResult ]
139
+ run_in_default_project_without_models : Callable [..., RunResult ]
136
140
) -> None :
137
141
138
142
os .remove ("domain.yml" )
139
- run_in_default_project (
143
+ run_in_default_project_without_models (
140
144
"train" ,
141
145
"-c" ,
142
146
"config.yml" ,
@@ -191,38 +195,36 @@ def test_train_force(run_in_default_project):
191
195
assert len (files ) == 2
192
196
193
197
194
- def test_train_with_only_nlu_data (run_in_default_project ):
198
+ def test_train_with_only_nlu_data (run_in_default_project_without_models ):
195
199
temp_dir = os .getcwd ()
196
200
197
201
assert os .path .exists (os .path .join (temp_dir , "data/stories.md" ))
198
202
os .remove (os .path .join (temp_dir , "data/stories.md" ))
199
- shutil .rmtree (os .path .join (temp_dir , "models" ))
200
203
201
- run_in_default_project ("train" , "--fixed-model-name" , "test-model" )
204
+ run_in_default_project_without_models ("train" , "--fixed-model-name" , "test-model" )
202
205
203
206
assert os .path .exists (os .path .join (temp_dir , "models" ))
204
207
files = io_utils .list_files (os .path .join (temp_dir , "models" ))
205
208
assert len (files ) == 1
206
209
assert os .path .basename (files [0 ]) == "test-model.tar.gz"
207
210
208
211
209
- def test_train_with_only_core_data (run_in_default_project ):
212
+ def test_train_with_only_core_data (run_in_default_project_without_models ):
210
213
temp_dir = os .getcwd ()
211
214
212
215
assert os .path .exists (os .path .join (temp_dir , "data/nlu.md" ))
213
216
os .remove (os .path .join (temp_dir , "data/nlu.md" ))
214
- shutil .rmtree (os .path .join (temp_dir , "models" ))
215
217
216
- run_in_default_project ("train" , "--fixed-model-name" , "test-model" )
218
+ run_in_default_project_without_models ("train" , "--fixed-model-name" , "test-model" )
217
219
218
220
assert os .path .exists (os .path .join (temp_dir , "models" ))
219
221
files = io_utils .list_files (os .path .join (temp_dir , "models" ))
220
222
assert len (files ) == 1
221
223
assert os .path .basename (files [0 ]) == "test-model.tar.gz"
222
224
223
225
224
- def test_train_core (run_in_default_project : Callable [..., RunResult ]):
225
- run_in_default_project (
226
+ def test_train_core (run_in_default_project_without_models : Callable [..., RunResult ]):
227
+ run_in_default_project_without_models (
226
228
"train" ,
227
229
"core" ,
228
230
"-c" ,
@@ -241,10 +243,12 @@ def test_train_core(run_in_default_project: Callable[..., RunResult]):
241
243
assert os .path .isfile ("train_rasa_models/rasa-model.tar.gz" )
242
244
243
245
244
- def test_train_core_no_domain_exists (run_in_default_project : Callable [..., RunResult ]):
246
+ def test_train_core_no_domain_exists (
247
+ run_in_default_project_without_models : Callable [..., RunResult ]
248
+ ):
245
249
246
250
os .remove ("domain.yml" )
247
- run_in_default_project (
251
+ run_in_default_project_without_models (
248
252
"train" ,
249
253
"core" ,
250
254
"--config" ,
@@ -263,8 +267,8 @@ def test_train_core_no_domain_exists(run_in_default_project: Callable[..., RunRe
263
267
assert not os .path .isfile ("train_rasa_models_no_domain/rasa-model.tar.gz" )
264
268
265
269
266
- def test_train_nlu (run_in_default_project : Callable [..., RunResult ]):
267
- run_in_default_project (
270
+ def test_train_nlu (run_in_default_project_without_models : Callable [..., RunResult ]):
271
+ run_in_default_project_without_models (
268
272
"train" ,
269
273
"nlu" ,
270
274
"-c" ,
@@ -289,9 +293,9 @@ def test_train_nlu(run_in_default_project: Callable[..., RunResult]):
289
293
290
294
291
295
def test_train_nlu_persist_nlu_data (
292
- run_in_default_project : Callable [..., RunResult ]
296
+ run_in_default_project_without_models : Callable [..., RunResult ]
293
297
) -> None :
294
- run_in_default_project (
298
+ run_in_default_project_without_models (
295
299
"train" ,
296
300
"nlu" ,
297
301
"-c" ,
0 commit comments