@@ -37,34 +37,6 @@ def creation_hook(job):
3737 job .workspace ["output" ] = "creation hook ran"
3838
3939
40- @override_settings (JOBS = {"testjob" : {"tasks" : ["a" ]}})
41- class JobManagementCommandTestCase (TestCase ):
42- def test_create_job (self ):
43- call_command ("create_job" , "testjob" , stdout = StringIO ())
44- job = Job .objects .get ()
45- self .assertEqual (job .name , "testjob" )
46- self .assertEqual (job .queue_name , "default" )
47-
48- def test_create_job_with_workspace (self ):
49- workspace = '{"test": "test"}'
50- call_command ("create_job" , "testjob" , workspace = workspace , stdout = StringIO ())
51- job = Job .objects .get ()
52- self .assertEqual (job .workspace , {"test" : "test" })
53-
54- def test_create_job_with_queue_name (self ):
55- call_command ("create_job" , "testjob" , queue_name = "lol" , stdout = StringIO ())
56- job = Job .objects .get ()
57- self .assertEqual (job .name , "testjob" )
58- self .assertEqual (job .queue_name , "lol" )
59-
60- def test_errors_raised_correctly (self ):
61- with self .assertRaises (CommandError ):
62- call_command ("create_job" , stdout = StringIO ())
63-
64- with self .assertRaises (CommandError ):
65- call_command ("create_job" , "some_other_job" , stdout = StringIO ())
66-
67-
6840@override_settings (JOBS = {"testjob" : {"tasks" : ["a" ]}})
6941class WorkerManagementCommandTestCase (TestCase ):
7042 def test_worker_no_args (self ):
0 commit comments