コード例 #1
0
ファイル: test_ofmvol2csv.py プロジェクト: equinor/subscript
def test_extract_columnnames(filelines, expected):
    """Test the ability to extract columnnames from a string occuring in OFM lines"""
    if isinstance(expected, list):
        assert ofmvol2csv.extract_columnnames(filelines) == expected
    else:
        with pytest.raises(expected):
            ofmvol2csv.extract_columnnames(filelines)
コード例 #2
0
def test_parse_well(inputlines, expected):
    if "DATE" in expected:
        expected["DATE"] = pd.to_datetime(expected["DATE"])
        expected.set_index(["WELL", "DATE"], inplace=True)
    # Assume there is DATE line in the test input
    inputlines = ofmvol2csv.cleanse_ofm_lines(inputlines)
    colnames = ofmvol2csv.extract_columnnames(inputlines)
    dframe = ofmvol2csv.parse_well(inputlines[1:], colnames)
    pd.testing.assert_frame_equal(dframe, expected)
コード例 #3
0
def test_extract_columnnames(filelines, expected):
    if isinstance(expected, list):
        assert ofmvol2csv.extract_columnnames(filelines) == expected
    else:
        with pytest.raises(expected):
            ofmvol2csv.extract_columnnames(filelines)