def test_check_duplicate_sections():
    las = lascheck.read(readfromexamples("sample_duplicate_sections.las"))
    assert not las.check_conformity()
    assert las.get_non_conformities() == [
        'Duplicate v section', 'Duplicate w section', 'Duplicate c section',
        'Duplicate p section', 'Duplicate o section'
    ]
Exemple #2
0
def test_check_conforming_no_well_curves_ascii_section():
    las = lascheck.read(
        readfromexamples("missing_well_curves_ascii_section.las"))
    assert not las.check_conformity()
    assert las.get_non_conformities() == [
        'Missing mandatory sections: [\'~W\', \'~C\', \'~A\']',
        'Missing mandatory lines in ~w Section'
    ]
Exemple #3
0
def test_check_conforming_no_ascii_section():
    las = lascheck.read(readfromexamples("missing_ascii_section.las"))
    assert not las.check_conformity()
    assert las.get_non_conformities() == [
        'Missing mandatory sections: [\'~A\']'
    ]
Exemple #4
0
def test_check_conforming_positive():
    las = lascheck.read(readfromexamples("sample.las"))
    assert las.check_conformity()
    assert las.get_non_conformities() == []
Exemple #5
0
def test_check_blank_line_in_ascii_section():
    las = lascheck.read(readfromexamples("blank_line_in_ascii_section.las"))
    assert not spec.BlankLineInSection.check(las)
    assert las.get_non_conformities() == ["Section ~A having blank line"]
Exemple #6
0
def test_check_blank_line_in_version_section():
    las = lascheck.read(readfromexamples("blank_line_in_version_section.las"))
    # import pdb; pdb.set_trace()
    assert not spec.BlankLineInSection.check(las)
    assert las.get_non_conformities() == ["Section ~VERSION having blank line"]
Exemple #7
0
def test_check_valid_mnemonic():
    las = lascheck.read(readfromexamples("invalid_index_mnemonic.las"))
    assert not las.check_conformity()
    assert las.get_non_conformities() == ["Invalid index mnemonic. "
                                         "The only valid mnemonics for the index channel are DEPT, DEPTH, TIME, or INDEX."]
Exemple #8
0
def test_check_no_version_section():
    las = lascheck.read(readfromexamples("missing_version_section.las"))
    assert not spec.MandatoryLinesInVersionSection.check(las)
    assert las.get_non_conformities() == [
        'Missing mandatory sections: [\'~V\']', '~v section not first'
    ]
Exemple #9
0
def test_check_sections_before_a_section():
    las = lascheck.read(
        readfromexamples("sample_sections_before_a_section.las"))
    assert las.check_conformity()
    assert las.get_non_conformities() == []
Exemple #10
0
def test_check_sections_after_a_section_2():
    las = lascheck.read(
        readfromexamples("sample_sections_after_a_section_2.las"))
    assert not las.check_conformity()
    assert las.get_non_conformities() == ["Sections after ~a section"]
Exemple #11
0
def test_check_no_well_section():
    las = lascheck.read(readfromexamples("missing_well_section.las"))
    assert not spec.MandatoryLinesInWellSection.check(las)
Exemple #12
0
def test_check_no_well_uwi_having_api():
    las = lascheck.read(readfromexamples("missing_well_uwi_having_api.las"))
    assert las.check_conformity()
    assert las.get_non_conformities() == []
Exemple #13
0
def test_check_blank_lines_in_two_section():
    las = lascheck.read(readfromexamples("blank_line_in_two_sections.las"))
    assert not spec.BlankLineInSection.check(las)
    assert las.get_non_conformities() == [
        "Section ~CURVE having blank line",
        "Section ~PARAMETER having blank line"]
Exemple #14
0
def test_check_valid_depth_unit_mismatch():
    las = lascheck.read(readfromexamples("invalid_depth_unit_mismatch.las"))
    assert not las.check_conformity()
    assert las.get_non_conformities() == ["If the index is depth, the units must be M (metres), F (feet) or FT (feet)"]
Exemple #15
0
def test_check_ascii_for_no_curves():
    las = lascheck.read(readfromexamples("missing_curves_section.las"))
    assert spec.AsciiSectionExists.check(las)
    assert las.get_non_conformities() == [
        'Missing mandatory sections: [\'~C\']'
    ]
Exemple #16
0
def test_check_v_section_first():
    las = lascheck.read(readfromexamples("sample_v_section_second.las"))
    assert not las.check_conformity()
    assert las.get_non_conformities() == ["~v section not first"]
Exemple #17
0
def test_check_no_wrap():
    las = lascheck.read(readfromexamples("missing_wrap.las"))
    assert not las.check_conformity()
    assert las.get_non_conformities() == [
        'Missing mandatory lines in ~v Section'
    ]
Exemple #18
0
def test_check_depth_divide_by_step():
    las = lascheck.read(readfromexamples("sample.las"))
    assert spec.ValidDepthDividedByStep.check(las)
Exemple #19
0
def test_check_no_well_well():
    las = lascheck.read(readfromexamples("missing_well_well.las"))
    assert not las.check_conformity()
    assert las.get_non_conformities() == [
        "Missing mandatory lines in ~w Section"
    ]
Exemple #20
0
def test_check_invalid_step():
    las = lascheck.read(readfromexamples("sample_invalid_step.las"))
    assert not las.check_conformity()
    assert las.get_non_conformities() == ['STRT divided by step is not a whole number',
                                          'STOP divided by step is not a whole number']