Пример #1
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.'
Пример #2
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'
Пример #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.'
Пример #4
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'
Пример #5
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'
Пример #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'
Пример #7
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'
Пример #8
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.'
Пример #9
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)'