From 31791736a7732a9dbf50af7305d7cacd65b87f25 Mon Sep 17 00:00:00 2001 From: YutoTakaki Date: Sat, 12 Aug 2023 02:59:33 +0000 Subject: [PATCH] add mock for Quantum_Neuron --- test/integ_tests/mock_utils.py | 4 ++++ test/integ_tests/textbook/Quantum_Neuron_mocks.py | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/test/integ_tests/mock_utils.py b/test/integ_tests/mock_utils.py index 335872f8..9c5b72b7 100644 --- a/test/integ_tests/mock_utils.py +++ b/test/integ_tests/mock_utils.py @@ -27,6 +27,10 @@ def set_get_device_result(self, result): def set_create_quantum_task_result(self, result): self._wrapper.boto_client.create_quantum_task.return_value = result + + ### test + def set_create_job_result(self, result): + self._wrapper.boto_client.create_job.return_value = result def set_get_quantum_task_result(self, result): self._wrapper.boto_client.get_quantum_task.return_value = result diff --git a/test/integ_tests/textbook/Quantum_Neuron_mocks.py b/test/integ_tests/textbook/Quantum_Neuron_mocks.py index b11f81e3..d2269731 100644 --- a/test/integ_tests/textbook/Quantum_Neuron_mocks.py +++ b/test/integ_tests/textbook/Quantum_Neuron_mocks.py @@ -1,6 +1,11 @@ def pre_run_inject(mock_utils): mocker = mock_utils.Mocker() mock_utils.mock_default_device_calls(mocker) + mocker.set_create_job_result( + { + "jobArn": "arn:aws:braket:us-east-1:000000:job/TestARN" + } + ) mocker.set_task_result_return(mock_utils.read_file("quantum_neuron_results.json", __file__))