Example #1
0
def test_check_assembly_data2():
    """ improper assembly input """
    with pytest.raises(AssertionError) as err_info:
        PyDampCheck.check_assembly_data(assembly_fail_2)
    assert str(
        err_info.value
    ) == 'assembly data for component 1 entry is improperly formated.'
Example #2
0
def test_check_assembly_data3():
    """ assembly input not a interger """
    with pytest.raises(AssertionError) as err_info:
        PyDampCheck.check_assembly_data(assembly_fail_3)
    assert str(
        err_info.value
    ) == 'assembly data for component 1 requires integer assembly data input'
Example #3
0
def test_check_flow_data22():
    """ output flow component is not an interger or unknown"""
    with pytest.raises(AssertionError) as err_info:
        PyDampCheck.check_flow_data(flow_fail_22)
    assert str(
        err_info.value
    ) == 'Flow data for component 3 function 2 needs to be an integer, internal, or external.'
Example #4
0
def test_check_flow_data24():
    """ output flow type not an integer"""
    with pytest.raises(AssertionError) as err_info:
        PyDampCheck.check_flow_data(flow_fail_24)
    assert str(
        err_info.value
    ) == 'Flow data for component 3 function 2 needs to be an integer.'
Example #5
0
def test_check_flow_data23():
    """ output flow component is out of bounds"""
    with pytest.raises(AssertionError) as err_info:
        PyDampCheck.check_flow_data(flow_fail_23)
    assert str(
        err_info.value
    ) == 'component 3 function 2 input in not in range of the BOM inputs'
Example #6
0
def test_check_flow_data15():
    """ error in defining false or unknown flow"""
    with pytest.raises(AssertionError) as err_info:
        PyDampCheck.check_flow_data(flow_fail_15)
    assert str(
        err_info.value
    ) == 'component 3 function 2 has error in false naming if function is unknown or must be an integer'
Example #7
0
def test_check_flow_data25():
    """ output flow out of flow index"""
    with pytest.raises(AssertionError) as err_info:
        PyDampCheck.check_flow_data(flow_fail_25)
    assert str(
        err_info.value
    ) == 'component 3 function 2 input in not in range of the flow index'
Example #8
0
def test_check_flow_data3():
    """ mising flow for one function """
    with pytest.raises(AssertionError) as err_info:
        PyDampCheck.check_flow_data(flow_fail_3)
    assert str(
        err_info.value
    ) == 'component 1 flow data input in not in range of the function inputs or is not formatted correctly'
Example #9
0
def test_check_flow_data21():
    """ output flow component is unknown but the string is wrong"""
    with pytest.raises(AssertionError) as err_info:
        PyDampCheck.check_flow_data(flow_fail_21)
    assert str(
        err_info.value
    ) == 'component 3 function 2 input error for assigning internal or external'
Example #10
0
def test_check_assembly_data4():
    """ assembly input out of bounds """
    with pytest.raises(AssertionError) as err_info:
        PyDampCheck.check_assembly_data(assembly_fail_4)
    assert str(
        err_info.value
    ) == 'assembly data for component 1 assembly data input in not in range of the BOM inputs'
Example #11
0
def test_check_BOM10():
    """ Component basis defined out of index bounds """
    with pytest.raises(AssertionError) as err_info:
        PyDampCheck.check_BOM(BOM_fail_10)
    assert str(
        err_info.value
    ) == 'component 1 component basis input not within range of index'
Example #12
0
def test_check_BOM8():
    """ Missing component basis input """
    with pytest.raises(AssertionError) as err_info:
        PyDampCheck.check_BOM(BOM_fail_8)
    assert str(
        err_info.value
    ) == 'component 1 component basis requires component basis input'
Example #13
0
def test_check_user_name3():
    """ Empty Input """
    with pytest.raises(AssertionError) as err_info:
        PyDampCheck.check_user_name(name_fail_3)
    assert str(err_info.value) == 'Input file requires user name'
Example #14
0
def test_check_flow_data2():
    """ missing flow data for one component """
    with pytest.raises(AssertionError) as err_info:
        PyDampCheck.check_flow_data(flow_fail_2)
    assert str(err_info.value
               ) == 'There is not alteast one flow datum for each component.'
Example #15
0
def test_check_flow_data1():
    """ no flow data """
    with pytest.raises(AssertionError) as err_info:
        PyDampCheck.check_flow_data(flow_fail_1)
    assert str(err_info.value) == 'Input file requires Flow data input(s)'
Example #16
0
def test_check_BOM4():
    """ Missing Component Name """
    with pytest.raises(AssertionError) as err_info:
        PyDampCheck.check_BOM(BOM_fail_4)
    assert str(err_info.value) == 'component 1 needs a name.'
Example #17
0
def test_check_BOM6():
    """ Missing Component Discription """
    with pytest.raises(AssertionError) as err_info:
        PyDampCheck.check_BOM(BOM_fail_6)
    assert str(err_info.value) == 'component 1 needs a discription.'
Example #18
0
def test_check_BOM13():
    """ material defined out of index bounds """
    with pytest.raises(AssertionError) as err_info:
        PyDampCheck.check_BOM(BOM_fail_13)
    assert str(err_info.value
               ) == 'component 1 material input not within range of index'
Example #19
0
def test_check_BOM12():
    """ material input not a integer """
    with pytest.raises(AssertionError) as err_info:
        PyDampCheck.check_BOM(BOM_fail_12)
    assert str(err_info.value) == 'component 1 material requires integer input'
Example #20
0
def test_check_BOM11():
    """ Missing component material input """
    with pytest.raises(AssertionError) as err_info:
        PyDampCheck.check_BOM(BOM_fail_11)
    assert str(
        err_info.value) == 'component 1 material requires material input'
Example #21
0
def test_check_BOM9():
    """ Component basis input not a integer """
    with pytest.raises(AssertionError) as err_info:
        PyDampCheck.check_BOM(BOM_fail_9)
    assert str(
        err_info.value) == 'component 1 component basis requires integer input'
Example #22
0
def test_check_BOM7():
    """ Interger Component Discription """
    with pytest.raises(AssertionError) as err_info:
        PyDampCheck.check_BOM(BOM_fail_7)
    assert str(
        err_info.value) == 'component 1 description requires character input.'
Example #23
0
def test_check_assembly_data1():
    """ Assembly empty"""
    with pytest.raises(AssertionError) as err_info:
        PyDampCheck.check_assembly_data(assembly_fail_1)
    assert str(err_info.value) == 'Input file requires Assembly data input(s)'
Example #24
0
def test_check_BOM5():
    """ Interger Component Name """
    with pytest.raises(AssertionError) as err_info:
        PyDampCheck.check_BOM(BOM_fail_5)
    assert str(err_info.value) == 'component 1 name requires charater input.'
Example #25
0
def test_check_employer1():
    """ Non - String Input """
    with pytest.raises(AssertionError) as err_info:
        PyDampCheck.check_employer(employer_fail_1)
    assert str(err_info.value) == 'Input file requires character input'
Example #26
0
def test_check_BOM2():
    """ Empty List Input """
    with pytest.raises(AssertionError) as err_info:
        PyDampCheck.check_BOM(BOM_fail_2)
    assert str(err_info.value) == 'component 1 entry is improperly formated.'
Example #27
0
def test_check_OSU_Student2():
    """ Non - String Input """
    with pytest.raises(AssertionError) as err_info:
        PyDampCheck.check_osu_student(OSU_fail_2)
    assert str(err_info.value) == 'Input file requires yes or no input'
Example #28
0
def test_check_BOM3():
    """ improper length BOM input """
    with pytest.raises(AssertionError) as err_info:
        PyDampCheck.check_BOM(BOM_fail_3)
    assert str(err_info.value) == 'component 1 entry is improperly formated.'
Example #29
0
def test_check_employer2():
    """ Forced string input but is integer """
    with pytest.raises(AssertionError) as err_info:
        PyDampCheck.check_employer(employer_fail_2)
    assert str(err_info.value) == 'Input file requires character input'
Example #30
0
def test_check_BOM1():
    """ Empty Input """
    with pytest.raises(AssertionError) as err_info:
        PyDampCheck.check_BOM(BOM_fail_1)
    assert str(err_info.value) == 'Input file requires BOM input'