@@ -97,7 +97,10 @@ def test_ionq_client_create_job(mock_post):
9797
9898 client = ionq .ionq_client ._IonQClient (remote_host = 'http://example.com' , api_key = 'to_my_heart' )
9999 program = ionq .SerializedProgram (
100- body = {'job' : 'mine' }, metadata = {'a' : '0,1' }, error_mitigation = {'debias' : True }
100+ body = {'job' : 'mine' },
101+ metadata = {'a' : '0,1' },
102+ settings = {'aaa' : 'bb' },
103+ error_mitigation = {'debias' : True },
101104 )
102105 response = client .create_job (
103106 serialized_program = program , repetitions = 200 , target = 'qpu' , name = 'bacon'
@@ -109,9 +112,10 @@ def test_ionq_client_create_job(mock_post):
109112 'lang' : 'json' ,
110113 'body' : {'job' : 'mine' },
111114 'name' : 'bacon' ,
115+ 'metadata' : {'shots' : '200' , 'a' : '0,1' },
116+ 'settings' : {'aaa' : 'bb' },
112117 'shots' : '200' ,
113118 'error_mitigation' : {'debias' : True },
114- 'metadata' : {'shots' : '200' , 'a' : '0,1' },
115119 }
116120 expected_headers = {
117121 'Authorization' : 'apiKey to_my_heart' ,
@@ -129,7 +133,7 @@ def test_ionq_client_create_job_extra_params(mock_post):
129133 mock_post .return_value .json .return_value = {'foo' : 'bar' }
130134
131135 client = ionq .ionq_client ._IonQClient (remote_host = 'http://example.com' , api_key = 'to_my_heart' )
132- program = ionq .SerializedProgram (body = {'job' : 'mine' }, metadata = {'a' : '0,1' })
136+ program = ionq .SerializedProgram (body = {'job' : 'mine' }, metadata = {'a' : '0,1' }, settings = {} )
133137 response = client .create_job (
134138 serialized_program = program ,
135139 repetitions = 200 ,
@@ -166,7 +170,7 @@ def test_ionq_client_create_job_default_target(mock_post):
166170 client = ionq .ionq_client ._IonQClient (
167171 remote_host = 'http://example.com' , api_key = 'to_my_heart' , default_target = 'simulator'
168172 )
169- _ = client .create_job (ionq .SerializedProgram (body = {'job' : 'mine' }, metadata = {}))
173+ _ = client .create_job (ionq .SerializedProgram (body = {'job' : 'mine' }, metadata = {}, settings = {} ))
170174 assert mock_post .call_args [1 ]['json' ]['target' ] == 'simulator'
171175
172176
@@ -179,7 +183,7 @@ def test_ionq_client_create_job_target_overrides_default_target(mock_post):
179183 remote_host = 'http://example.com' , api_key = 'to_my_heart' , default_target = 'simulator'
180184 )
181185 _ = client .create_job (
182- serialized_program = ionq .SerializedProgram (body = {'job' : 'mine' }, metadata = {}),
186+ serialized_program = ionq .SerializedProgram (body = {'job' : 'mine' }, metadata = {}, settings = {} ),
183187 target = 'qpu' ,
184188 repetitions = 1 ,
185189 )
@@ -190,7 +194,9 @@ def test_ionq_client_create_job_no_targets():
190194 client = ionq .ionq_client ._IonQClient (remote_host = 'http://example.com' , api_key = 'to_my_heart' )
191195 with pytest .raises (AssertionError , match = 'neither were set' ):
192196 _ = client .create_job (
193- serialized_program = ionq .SerializedProgram (body = {'job' : 'mine' }, metadata = {})
197+ serialized_program = ionq .SerializedProgram (
198+ body = {'job' : 'mine' }, metadata = {}, settings = {}
199+ )
194200 )
195201
196202
@@ -204,7 +210,9 @@ def test_ionq_client_create_job_unauthorized(mock_post):
204210 )
205211 with pytest .raises (ionq .IonQException , match = 'Not authorized' ):
206212 _ = client .create_job (
207- serialized_program = ionq .SerializedProgram (body = {'job' : 'mine' }, metadata = {})
213+ serialized_program = ionq .SerializedProgram (
214+ body = {'job' : 'mine' }, metadata = {}, settings = {}
215+ )
208216 )
209217
210218
@@ -218,7 +226,9 @@ def test_ionq_client_create_job_not_found(mock_post):
218226 )
219227 with pytest .raises (ionq .IonQNotFoundException , match = 'not find' ):
220228 _ = client .create_job (
221- serialized_program = ionq .SerializedProgram (body = {'job' : 'mine' }, metadata = {})
229+ serialized_program = ionq .SerializedProgram (
230+ body = {'job' : 'mine' }, metadata = {}, settings = {}
231+ )
222232 )
223233
224234
@@ -232,7 +242,9 @@ def test_ionq_client_create_job_not_retriable(mock_post):
232242 )
233243 with pytest .raises (ionq .IonQException , match = 'Status: 409' ):
234244 _ = client .create_job (
235- serialized_program = ionq .SerializedProgram (body = {'job' : 'mine' }, metadata = {})
245+ serialized_program = ionq .SerializedProgram (
246+ body = {'job' : 'mine' }, metadata = {}, settings = {}
247+ )
236248 )
237249
238250
@@ -253,7 +265,9 @@ def test_ionq_client_create_job_retry(mock_post):
253265 test_stdout = io .StringIO ()
254266 with contextlib .redirect_stdout (test_stdout ):
255267 _ = client .create_job (
256- serialized_program = ionq .SerializedProgram (body = {'job' : 'mine' }, metadata = {})
268+ serialized_program = ionq .SerializedProgram (
269+ body = {'job' : 'mine' }, metadata = {}, settings = {}
270+ )
257271 )
258272 assert test_stdout .getvalue ().strip () == 'Waiting 0.1 seconds before retrying.'
259273 assert mock_post .call_count == 2
@@ -268,7 +282,7 @@ def test_ionq_client_create_job_retry_request_error(mock_post):
268282 remote_host = 'http://example.com' , api_key = 'to_my_heart' , default_target = 'simulator'
269283 )
270284 _ = client .create_job (
271- serialized_program = ionq .SerializedProgram (body = {'job' : 'mine' }, metadata = {})
285+ serialized_program = ionq .SerializedProgram (body = {'job' : 'mine' }, metadata = {}, settings = {} )
272286 )
273287 assert mock_post .call_count == 2
274288
@@ -286,7 +300,9 @@ def test_ionq_client_create_job_timeout(mock_post):
286300 )
287301 with pytest .raises (TimeoutError ):
288302 _ = client .create_job (
289- serialized_program = ionq .SerializedProgram (body = {'job' : 'mine' }, metadata = {})
303+ serialized_program = ionq .SerializedProgram (
304+ body = {'job' : 'mine' }, metadata = {}, settings = {}
305+ )
290306 )
291307
292308
0 commit comments