Skip to content

Commit

Permalink
improve tests
Browse files Browse the repository at this point in the history
  • Loading branch information
WingCode committed Jun 6, 2024
1 parent 065f13e commit a56011c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions tests/providers/test_braket_quantum_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,20 @@ def test_queue_position(self, mock_aws_quantum_task):
task = BraketQuantumTask(
backend=Mock(spec=AWSBraketBackend),
task_id="arn:aws:braket:::quantum-task/AwesomeId",
tasks=[Mock(spec=AwsQuantumTask)],
tasks=[mock_aws_quantum_task],
shots=10,
)
mock_aws_quantum_task.queue_position.return_value = QuantumTaskQueueInfo(
queue_type=QueueType.NORMAL, queue_position=1, message=None
mock_aws_quantum_task.return_value.queue_position.return_value = (
QuantumTaskQueueInfo(
queue_type=QueueType.NORMAL, queue_position=1, message=None
)
)
task_queue = task.queue_position()

mock_aws_quantum_task.assert_called_once()
mock_aws_quantum_task.return_value.queue_position.assert_called_once()
mock_aws_quantum_task.assert_called_once_with(
"arn:aws:braket:::quantum-task/AwesomeId"
)
assert task_queue

@patch("qiskit_braket_provider.providers.braket_quantum_task.AwsQuantumTask")
Expand Down

0 comments on commit a56011c

Please sign in to comment.