# coding: utf-8

"""
    Aliro Quantum App

    This is an api for the Aliro Quantum App  # noqa: E501

    The version of the OpenAPI document: 1.0.0
    Contact: nick@aliroquantum.com
    Generated by: https://openapi-generator.tech
"""


from __future__ import absolute_import

import unittest
import datetime

import aliro_quantum
from aliro_quantum.models.submission import Submission  # noqa: E501
from aliro_quantum.rest import ApiException

class TestSubmission(unittest.TestCase):
    """Submission unit test stubs"""

    def setUp(self):
        pass

    def tearDown(self):
        pass

    def make_instance(self, include_optional):
        """Test Submission
            include_option is a boolean, when False only required
            params are included, when True both required and
            optional params are included """
        # model = aliro_quantum.models.submission.Submission()  # noqa: E501
        if include_optional :
            return Submission(
                circuits = [
                    aliro_quantum.models.circuit.Circuit(
                        body = '0', 
                        depth = 56, 
                        jobs = [
                            aliro_quantum.models.job.Job(
                                allocations = aliro_quantum.models.job_allocations.Job_allocations(
                                    allocated_circuits = [
                                        aliro_quantum.models.allocation.Allocation(
                                            allocated_qubits = [
                                                56
                                                ], 
                                            depth = 56, 
                                            program = '0', 
                                            num_gates_double = 56, 
                                            num_gates_single = 56, 
                                            num_measurements = 56, 
                                            num_swaps = 56, )
                                        ], 
                                    input_parameters = aliro_quantum.models.compilation_parameters.CompilationParameters(
                                        compilation_type = '0', 
                                        num_allocations = 56, ), 
                                    language = '0', 
                                    runtime = 1.337, ), 
                                cancelling = True, 
                                costs = aliro_quantum.models.job_costs.Job_costs(
                                    reservation = 1.337, ), 
                                errors = [
                                    aliro_quantum.models.job_errors.Job_errors(
                                        error_code = '0', 
                                        error_message = '0', )
                                    ], 
                                execution = aliro_quantum.models.job_execution.Job_execution(
                                    parameters = aliro_quantum.models.execution_parameters.ExecutionParameters(
                                        num_shots = 56, 
                                        output_type = '0', ), 
                                    results = aliro_quantum.models.execution_results.ExecutionResults(
                                        real = aliro_quantum.models.results_data.ResultsData(
                                            empirical_sso = 1.337, 
                                            end_datetime = '0', 
                                            measurements = aliro_quantum.models.results_data_measurements.ResultsData_measurements(
                                                raw = [
                                                    [
                                                        [
                                                            56
                                                            ]
                                                        ]
                                                    ], 
                                                weighted_combination = {
                                                    'key' : 1.337
                                                    }, ), 
                                            runtime = 1.337, 
                                            start_datetime = '0', ), 
                                        simulated = aliro_quantum.models.results_data.ResultsData(
                                            empirical_sso = 1.337, 
                                            end_datetime = '0', 
                                            runtime = 1.337, 
                                            start_datetime = '0', ), ), ), 
                                id = '0', 
                                reservation = aliro_quantum.models.reservation.Reservation(
                                    end_datetime = '0', 
                                    id = '0', 
                                    price = 1.337, 
                                    start_datetime = '0', 
                                    their_id = '0', ), 
                                target = aliro_quantum.models.owner_details.OwnerDetails(
                                    owners = {
                                        'key' : aliro_quantum.models.owner_details_owners.OwnerDetails_owners(
                                            devices = {
                                                'key' : aliro_quantum.models.device_details.DeviceDetails(
                                                    active_reset_fidelity = 1.337, 
                                                    depth_one_circuit_time = 1.337, 
                                                    device_id = '0', 
                                                    display_name = '0', 
                                                    gate_info = aliro_quantum.models.device_details_gate_info.DeviceDetails_gateInfo(
                                                        averages = {
                                                            'key' : aliro_quantum.models.device_details_gate_info_averages.DeviceDetails_gateInfo_averages(
                                                                current = 1.337, 
                                                                fidelity_change_per_day = 1.337, )
                                                            }, 
                                                        gate_list = [
                                                            aliro_quantum.models.gate.Gate(
                                                                aliro_computed = True, 
                                                                fidelity = 1.337, 
                                                                fidelity_change_per_day = 1.337, 
                                                                qubit_from = aliro_quantum.models.qubit.Qubit(
                                                                    name = 56, 
                                                                    pos_x = 1.337, 
                                                                    pos_y = 1.337, 
                                                                    real_qubit = 56, 
                                                                    t1 = 1.337, 
                                                                    t2 = 1.337, ), 
                                                                qubit_to = aliro_quantum.models.qubit.Qubit(
                                                                    name = 56, 
                                                                    pos_x = 1.337, 
                                                                    pos_y = 1.337, 
                                                                    real_qubit = 56, 
                                                                    t1 = 1.337, 
                                                                    t2 = 1.337, ), 
                                                                gate_type = '0', )
                                                            ], ), 
                                                    gates = [
                                                        aliro_quantum.models.gate.Gate(
                                                            aliro_computed = True, 
                                                            fidelity = 1.337, 
                                                            fidelity_change_per_day = 1.337, 
                                                            gate_type = '0', )
                                                        ], 
                                                    initialization_time = 1.337, 
                                                    is_simulator = True, 
                                                    jobs_queue_size = 56, 
                                                    last_calibration = '0', 
                                                    max_shots = 56, 
                                                    next_available_time = '0', 
                                                    price = 1.337, 
                                                    quantum_volume = 56, 
                                                    qubits = {
                                                        'key' : aliro_quantum.models.qubit.Qubit(
                                                            name = 56, 
                                                            pos_x = 1.337, 
                                                            pos_y = 1.337, 
                                                            real_qubit = 56, 
                                                            t1 = 1.337, 
                                                            t2 = 1.337, )
                                                        }, 
                                                    supports_mid_circuit_measurement = True, 
                                                    t1 = 1.337, 
                                                    t2 = 1.337, )
                                                }, )
                                        }, ), )
                            ], 
                        language = '0', 
                        name = '0', 
                        num_gates_double = 56, 
                        num_gates_single = 56, 
                        num_measurements = 56, 
                        num_swaps = 56, )
                    ], 
                create_date = '0', 
                name = '0'
            )
        else :
            return Submission(
                circuits = [
                    aliro_quantum.models.circuit.Circuit(
                        body = '0', 
                        depth = 56, 
                        jobs = [
                            aliro_quantum.models.job.Job(
                                allocations = aliro_quantum.models.job_allocations.Job_allocations(
                                    allocated_circuits = [
                                        aliro_quantum.models.allocation.Allocation(
                                            allocated_qubits = [
                                                56
                                                ], 
                                            depth = 56, 
                                            program = '0', 
                                            num_gates_double = 56, 
                                            num_gates_single = 56, 
                                            num_measurements = 56, 
                                            num_swaps = 56, )
                                        ], 
                                    input_parameters = aliro_quantum.models.compilation_parameters.CompilationParameters(
                                        compilation_type = '0', 
                                        num_allocations = 56, ), 
                                    language = '0', 
                                    runtime = 1.337, ), 
                                cancelling = True, 
                                costs = aliro_quantum.models.job_costs.Job_costs(
                                    reservation = 1.337, ), 
                                errors = [
                                    aliro_quantum.models.job_errors.Job_errors(
                                        error_code = '0', 
                                        error_message = '0', )
                                    ], 
                                execution = aliro_quantum.models.job_execution.Job_execution(
                                    parameters = aliro_quantum.models.execution_parameters.ExecutionParameters(
                                        num_shots = 56, 
                                        output_type = '0', ), 
                                    results = aliro_quantum.models.execution_results.ExecutionResults(
                                        real = aliro_quantum.models.results_data.ResultsData(
                                            empirical_sso = 1.337, 
                                            end_datetime = '0', 
                                            measurements = aliro_quantum.models.results_data_measurements.ResultsData_measurements(
                                                raw = [
                                                    [
                                                        [
                                                            56
                                                            ]
                                                        ]
                                                    ], 
                                                weighted_combination = {
                                                    'key' : 1.337
                                                    }, ), 
                                            runtime = 1.337, 
                                            start_datetime = '0', ), 
                                        simulated = aliro_quantum.models.results_data.ResultsData(
                                            empirical_sso = 1.337, 
                                            end_datetime = '0', 
                                            runtime = 1.337, 
                                            start_datetime = '0', ), ), ), 
                                id = '0', 
                                reservation = aliro_quantum.models.reservation.Reservation(
                                    end_datetime = '0', 
                                    id = '0', 
                                    price = 1.337, 
                                    start_datetime = '0', 
                                    their_id = '0', ), 
                                target = aliro_quantum.models.owner_details.OwnerDetails(
                                    owners = {
                                        'key' : aliro_quantum.models.owner_details_owners.OwnerDetails_owners(
                                            devices = {
                                                'key' : aliro_quantum.models.device_details.DeviceDetails(
                                                    active_reset_fidelity = 1.337, 
                                                    depth_one_circuit_time = 1.337, 
                                                    device_id = '0', 
                                                    display_name = '0', 
                                                    gate_info = aliro_quantum.models.device_details_gate_info.DeviceDetails_gateInfo(
                                                        averages = {
                                                            'key' : aliro_quantum.models.device_details_gate_info_averages.DeviceDetails_gateInfo_averages(
                                                                current = 1.337, 
                                                                fidelity_change_per_day = 1.337, )
                                                            }, 
                                                        gate_list = [
                                                            aliro_quantum.models.gate.Gate(
                                                                aliro_computed = True, 
                                                                fidelity = 1.337, 
                                                                fidelity_change_per_day = 1.337, 
                                                                qubit_from = aliro_quantum.models.qubit.Qubit(
                                                                    name = 56, 
                                                                    pos_x = 1.337, 
                                                                    pos_y = 1.337, 
                                                                    real_qubit = 56, 
                                                                    t1 = 1.337, 
                                                                    t2 = 1.337, ), 
                                                                qubit_to = aliro_quantum.models.qubit.Qubit(
                                                                    name = 56, 
                                                                    pos_x = 1.337, 
                                                                    pos_y = 1.337, 
                                                                    real_qubit = 56, 
                                                                    t1 = 1.337, 
                                                                    t2 = 1.337, ), 
                                                                gate_type = '0', )
                                                            ], ), 
                                                    gates = [
                                                        aliro_quantum.models.gate.Gate(
                                                            aliro_computed = True, 
                                                            fidelity = 1.337, 
                                                            fidelity_change_per_day = 1.337, 
                                                            gate_type = '0', )
                                                        ], 
                                                    initialization_time = 1.337, 
                                                    is_simulator = True, 
                                                    jobs_queue_size = 56, 
                                                    last_calibration = '0', 
                                                    max_shots = 56, 
                                                    next_available_time = '0', 
                                                    price = 1.337, 
                                                    quantum_volume = 56, 
                                                    qubits = {
                                                        'key' : aliro_quantum.models.qubit.Qubit(
                                                            name = 56, 
                                                            pos_x = 1.337, 
                                                            pos_y = 1.337, 
                                                            real_qubit = 56, 
                                                            t1 = 1.337, 
                                                            t2 = 1.337, )
                                                        }, 
                                                    supports_mid_circuit_measurement = True, 
                                                    t1 = 1.337, 
                                                    t2 = 1.337, )
                                                }, )
                                        }, ), )
                            ], 
                        language = '0', 
                        name = '0', 
                        num_gates_double = 56, 
                        num_gates_single = 56, 
                        num_measurements = 56, 
                        num_swaps = 56, )
                    ],
                name = '0',
        )

    def testSubmission(self):
        """Test Submission"""
        inst_req_only = self.make_instance(include_optional=False)
        inst_req_and_optional = self.make_instance(include_optional=True)


if __name__ == '__main__':
    unittest.main()
