Skip to content

Commit

Permalink
Removing QuantumJob
Browse files Browse the repository at this point in the history
  • Loading branch information
delapuente committed Jun 21, 2018
1 parent 3eea61c commit 290e28d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
32 changes: 15 additions & 17 deletions test/python/_mockutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,25 +136,23 @@ def error(self):
return self._future.exception(timeout=0)


class FakeQJob():
"""Fakes qiskit._quantumjob.QuantumJob instances."""
def __init__(self):
self.backend = FakeBackend()
self.qobj = {
'id': 'test-id',
def new_fake_qobj():
"""Creates a fake qobj dictionary."""
return {
'id': 'test-id',
'config': {
'backend_name': 'test-backend',
'shots': 1024,
'max_credits': 100
},
'circuits': [{
'compiled_circuit_qasm': 'fake-code',
'config': {
'backend_name': self.backend.name,
'shots': 1024,
'max_credits': 100
'seed': 123456
},
'circuits': [{
'compiled_circuit_qasm': 'fake-code',
'config': {
'seed': 123456
},
'compiled_circuit': {}
}]
}
'compiled_circuit': {}
}]
}


class FakeBackend():
Expand Down
4 changes: 2 additions & 2 deletions test/python/test_ibmqjob_states.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from qiskit.backends.jobstatus import JobStatus
from qiskit.backends.ibmq.ibmqjob import IBMQJob, IBMQJobError
from .common import QiskitTestCase
from ._mockutils import FakeQJob
from ._mockutils import new_fake_qobj


class TestIBMQJobStates(QiskitTestCase):
Expand Down Expand Up @@ -221,7 +221,7 @@ def run_with_api(self, api):
"""Creates a new `IBMQJob` instance running with the provided API
object."""
self._current_api = api
self._current_qjob = IBMQJob(FakeQJob(), api, False)
self._current_qjob = IBMQJob(new_fake_qobj(), api, False)
return self._current_qjob


Expand Down

0 comments on commit 290e28d

Please sign in to comment.