# Path: pymoku/instruments.py

# 
# Path: pymoku/_arbwavegen.py
# REG_ARB_SETTINGS1 = 88
# REG_ARB_LUT_LENGTH1 = 105
# REG_ARB_AMPLITUDE1 = 106
# REG_ARB_OFFSET1 = 107
# REG_ARB_SETTINGS2 = 108
# REG_ARB_LUT_LENGTH2 = 125
# REG_ARB_AMPLITUDE2 = 126
# REG_ARB_OFFSET2 = 127
# _ARB_MODE_1000 = 0x0
# _ARB_MODE_500 = 0x1
# _ARB_MODE_250 = 0x2
# _ARB_MODE_125 = 0x3
# _ARB_LUT_LENGTH = 8192
# _ARB_LUT_LSB = 2.0**32
# _ARB_LUT_INTERPLOATION_LENGTH = 2**32
# _ARB_TRIG_SRC_CH1 = 0
# _ARB_TRIG_SRC_CH2 = 1
# _ARB_TRIG_SRC_EXT = 4
# _ARB_TRIG_LVL_MIN = -5.0
# _ARB_TRIG_LVL_MAX = 5.0
# _ARB_TRIG_TYPE_SINGLE = 0
# _ARB_TRIG_TYPE_CONT = 2
# _ARB_SMPL_RATE = 1.0e9
# _ARB_INPUT_SMPS = ADC_SMP_RATE
# _ARB_CHN_BUFLEN = 2**13
# class ArbitraryWaveGen(_CoreOscilloscope):
#     def __init__(self):
#     def set_defaults(self):
#     def _set_mode(self, ch, mode, length):
#     def write_lut(self, ch, data, mode=None):
#     def gen_waveform(self, ch, period, amplitude, phase=0, offset=0,
#                      interpolation=True, dead_time=0, dead_voltage=0, en=True):
#     def set_waveform_trigger(self, ch, source, edge, level, minwidth=None,
#                              maxwidth=None, hysteresis=False):
#     def set_waveform_trigger_output(self, ch, trig_en=True, single=False,
#                                     duration=0, hold_last=False):
#     def _update_dependent_regs(self, scales):
#     def sync_phase(self):
#     def reset_phase(self, ch):
#     def get_frequency(self, ch):
#     def gen_off(self, ch=None):
#     def enable_output(self, ch=None, en=True):
#     def _signal_source_volts_per_bit(self, source, scales, trigger=False):


import pytest
from pymoku.instruments import ArbitraryWaveGen
from pymoku import _arbwavegen
    from unittest.mock import ANY
    from mock import ANY


def test_gen_off(dut, moku):
    '''
    TODO Default test
    '''
    dut.gen_off()
    moku._write_regs.assert_called_with(ANY)


def test_enable_output(dut, moku):
    '''
    TODO Default test
    '''
    dut.enable_output()
    moku._write_regs.assert_called_with(ANY)


@pytest.mark.parametrize('attr, value', [
    ('enable1', True),
    ('phase_rst1', True),
    ('mode1', _arbwavegen._ARB_MODE_125),
    ('interpolation1', True),
    ('trig_source1', _arbwavegen._ARB_TRIG_SRC_CH1,),
    ('lut_length1', 1000),
    ('dead_value1', 0.0),
    ('amplitude1', 1.0),
    ('offset1', 0.0),
    ('enable2', True),
    ('phase_rst2', True),

# Path: pymoku/instruments.py

# 
# Path: pymoku/_arbwavegen.py
# REG_ARB_SETTINGS1 = 88
# REG_ARB_LUT_LENGTH1 = 105
# REG_ARB_AMPLITUDE1 = 106
# REG_ARB_OFFSET1 = 107
# REG_ARB_SETTINGS2 = 108
# REG_ARB_LUT_LENGTH2 = 125
# REG_ARB_AMPLITUDE2 = 126
# REG_ARB_OFFSET2 = 127
# _ARB_MODE_1000 = 0x0
# _ARB_MODE_500 = 0x1
# _ARB_MODE_250 = 0x2
# _ARB_MODE_125 = 0x3
# _ARB_LUT_LENGTH = 8192
# _ARB_LUT_LSB = 2.0**32
# _ARB_LUT_INTERPLOATION_LENGTH = 2**32
# _ARB_TRIG_SRC_CH1 = 0
# _ARB_TRIG_SRC_CH2 = 1
# _ARB_TRIG_SRC_EXT = 4
# _ARB_TRIG_LVL_MIN = -5.0
# _ARB_TRIG_LVL_MAX = 5.0
# _ARB_TRIG_TYPE_SINGLE = 0
# _ARB_TRIG_TYPE_CONT = 2
# _ARB_SMPL_RATE = 1.0e9
# _ARB_INPUT_SMPS = ADC_SMP_RATE
# _ARB_CHN_BUFLEN = 2**13
# class ArbitraryWaveGen(_CoreOscilloscope):
#     def __init__(self):
#     def set_defaults(self):
#     def _set_mode(self, ch, mode, length):
#     def write_lut(self, ch, data, mode=None):
#     def gen_waveform(self, ch, period, amplitude, phase=0, offset=0,
#                      interpolation=True, dead_time=0, dead_voltage=0, en=True):
#     def set_waveform_trigger(self, ch, source, edge, level, minwidth=None,
#                              maxwidth=None, hysteresis=False):
#     def set_waveform_trigger_output(self, ch, trig_en=True, single=False,
#                                     duration=0, hold_last=False):
#     def _update_dependent_regs(self, scales):
#     def sync_phase(self):
#     def reset_phase(self, ch):
#     def get_frequency(self, ch):
#     def gen_off(self, ch=None):
#     def enable_output(self, ch=None, en=True):
#     def _signal_source_volts_per_bit(self, source, scales, trigger=False):


# Path: tests/test_arbwavegen.py
import pytest
from pymoku.instruments import ArbitraryWaveGen
from pymoku import _arbwavegen
    from unittest.mock import ANY
    from mock import ANY



def test_gen_off(dut, moku):
    '''
    TODO Default test
    '''
    dut.gen_off()
    moku._write_regs.assert_called_with(ANY)


def test_enable_output(dut, moku):
    '''
    TODO Default test
    '''
    dut.enable_output()
    moku._write_regs.assert_called_with(ANY)


@pytest.mark.parametrize('attr, value', [
    ('enable1', True),
    ('phase_rst1', True),
    ('mode1', _arbwavegen._ARB_MODE_125),
    ('interpolation1', True),
    ('trig_source1', _arbwavegen._ARB_TRIG_SRC_CH1,),
    ('lut_length1', 1000),
    ('dead_value1', 0.0),
    ('amplitude1', 1.0),
    ('offset1', 0.0),
    ('enable2', True),
    ('phase_rst2', True),

    ('mode2', _arbwavegen._ARB_MODE_125),