# Path: nacc/uds3/ivp/builder.py
# def build_uds3_ivp_form(record, err=sys.stderr):
# def add_z1_or_z1x(record, packet):
# def add_a1(record, packet):
# def add_a2(record, packet):
# def add_a3(record, packet):
# def add_a4(record, packet):
# def add_a5(record, packet):
# def add_b1(record, packet):
# def add_b4(record, packet):
# def add_b5(record, packet):
# def add_b6(record, packet):
# def add_b7(record, packet):
# def add_b8(record, packet):
# def add_b9(record, packet):
# def add_c1s_or_c2(record, packet):
# def add_d1(record, packet):
# def add_d2(record, packet):
# def update_header(record, packet):
# 
# Path: nacc/uds3/fvp/builder.py
# def build_uds3_fvp_form(record, err=sys.stderr):
# def add_z1_or_z1x(record, packet):
# def add_a1(record, packet):
# def add_a2(record, packet):
# def add_a3(record, packet):
# def add_a4(record, packet):
# def add_b1(record, packet):
# def add_b4(record, packet):
# def add_b5(record, packet):
# def add_b6(record, packet):
# def add_b7(record, packet):
# def add_b8(record, packet):
# def add_b9(record, packet):
# def add_c1s_or_c2(record, packet):
# def add_d1(record, packet):
# def add_d2(record, packet):
# def update_header(record, packet):


import unittest
from nacc.uds3.ivp import builder as ivp_builder
from nacc.uds3.fvp import builder as fvp_builder

    def test_a2_ivp_skip(self):
        """ If the IVP A2 is not present in the csv, it should be skipped
        without throwing an error """
        record = make_blank_ivp()
        record['a2sub'] = '1'

        expected = record['othcondx']
        result = ivp_builder.build_uds3_ivp_form(record)
        self.assertEqual(expected, result['OTHCONDX'])

    def test_a2_fvp_skip(self):
        """ If the FVP A2 is not present in the csv, it should be skipped
        without throwing an error """
        record = make_blank_fvp()
        record['fu_a2sub'] = '1'

        expected = record['fu_othcondx']
        result = fvp_builder.build_uds3_fvp_form(record)
        self.assertEqual(expected, result['OTHCONDX'])

    def test_ivp_b4_not_skipped(self):
        """ Form B4 is required and should never be skipped. Testing B4 in
        particular because it is in the middle of the "add form" logic rather
        than outside the try/catch and if statements. """
        record = make_blank_ivp()
        record['langb4'] = ''
        record['cdrlang'] = '1'

        expected = record['cdrlang']

# Path: nacc/uds3/ivp/builder.py
# def build_uds3_ivp_form(record, err=sys.stderr):
# def add_z1_or_z1x(record, packet):
# def add_a1(record, packet):
# def add_a2(record, packet):
# def add_a3(record, packet):
# def add_a4(record, packet):
# def add_a5(record, packet):
# def add_b1(record, packet):
# def add_b4(record, packet):
# def add_b5(record, packet):
# def add_b6(record, packet):
# def add_b7(record, packet):
# def add_b8(record, packet):
# def add_b9(record, packet):
# def add_c1s_or_c2(record, packet):
# def add_d1(record, packet):
# def add_d2(record, packet):
# def update_header(record, packet):
# 
# Path: nacc/uds3/fvp/builder.py
# def build_uds3_fvp_form(record, err=sys.stderr):
# def add_z1_or_z1x(record, packet):
# def add_a1(record, packet):
# def add_a2(record, packet):
# def add_a3(record, packet):
# def add_a4(record, packet):
# def add_b1(record, packet):
# def add_b4(record, packet):
# def add_b5(record, packet):
# def add_b6(record, packet):
# def add_b7(record, packet):
# def add_b8(record, packet):
# def add_b9(record, packet):
# def add_c1s_or_c2(record, packet):
# def add_d1(record, packet):
# def add_d2(record, packet):
# def update_header(record, packet):


# Path: tests/test_skip_optional_forms_uds3.py
import unittest
from nacc.uds3.ivp import builder as ivp_builder
from nacc.uds3.fvp import builder as fvp_builder


    def test_a2_ivp_skip(self):
        """ If the IVP A2 is not present in the csv, it should be skipped
        without throwing an error """
        record = make_blank_ivp()
        record['a2sub'] = '1'

        expected = record['othcondx']
        result = ivp_builder.build_uds3_ivp_form(record)
        self.assertEqual(expected, result['OTHCONDX'])

    def test_a2_fvp_skip(self):
        """ If the FVP A2 is not present in the csv, it should be skipped
        without throwing an error """
        record = make_blank_fvp()
        record['fu_a2sub'] = '1'

        expected = record['fu_othcondx']
        result = fvp_builder.build_uds3_fvp_form(record)
        self.assertEqual(expected, result['OTHCONDX'])

    def test_ivp_b4_not_skipped(self):
        """ Form B4 is required and should never be skipped. Testing B4 in
        particular because it is in the middle of the "add form" logic rather
        than outside the try/catch and if statements. """
        record = make_blank_ivp()
        record['langb4'] = ''
        record['cdrlang'] = '1'

        expected = record['cdrlang']

        result = ivp_builder.build_uds3_ivp_form(record)