22
22
"output_formats" : ["ipynb" ],
23
23
}
24
24
25
- < << << << HEAD
26
25
27
26
def test_create_job_definition (jp_scheduler ):
28
27
with patch ("jupyter_scheduler.scheduler.fsspec" ) as mock_fsspec :
29
28
with patch ("jupyter_scheduler.scheduler.Scheduler.file_exists" ) as mock_file_exists :
30
29
mock_file_exists .return_value = True
31
30
job_definition_id = jp_scheduler .create_job_definition (
32
- CreateJobDefinition (** test_job_definition_parameters )
31
+ CreateJobDefinition (** test_job_def_params )
33
32
)
34
- == == == =
35
- def create_job_definition (jp_scheduler , job_def_params ):
36
- with patch ("jupyter_scheduler.scheduler.fsspec" ) as mock_fsspec :
37
- with patch ("jupyter_scheduler.scheduler.Scheduler.file_exists" ) as mock_file_exists :
38
- mock_file_exists .return_value = True
39
- job_definition_id = jp_scheduler .create_job_definition (CreateJobDefinition (** job_def_params ))
40
-
41
- return job_definition_id
42
-
43
- def test_create_job_definition (jp_scheduler ):
44
- job_definition_id = create_job_definition (jp_scheduler , test_job_def_params )
45
- > >> >> >> fb76d81 (add and use create_job_definition helper function )
46
33
47
34
with jp_scheduler .db_session () as session :
48
35
definitions = session .query (JobDefinition ).all ()
@@ -60,7 +47,10 @@ def test_create_job_definition(jp_scheduler):
60
47
61
48
62
49
def test_create_job_definition_with_on_events (jp_scheduler ):
63
- params_with_on_events = {** test_job_def_params , "on_events" : [EventType (** event_type_parameters )]}
50
+ params_with_on_events = {
51
+ ** test_job_def_params ,
52
+ "on_events" : [EventType (** event_type_parameters )],
53
+ }
64
54
create_job_definition (jp_scheduler , params_with_on_events )
65
55
66
56
with jp_scheduler .db_session () as session :
0 commit comments