Passed
Push — master ( ccfa4f...7f3a96 )
by Kent
58s
created

test_delete_section_item_by_mnemonic()   A

Complexity

Conditions 2

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
c 1
b 0
f 0
dl 0
loc 4
rs 10
1
import os, sys; sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
2
3
import fnmatch
4
5
import numpy as np
6
import pytest
7
8
import lasio
9
10
test_dir = os.path.dirname(__file__)
11
12
egfn = lambda fn: os.path.join(os.path.dirname(__file__), "examples", fn)
13
stegfn = lambda vers, fn: os.path.join(
14
    os.path.dirname(__file__), "examples", vers, fn)
15
16
def test_delete_curve():
17
    las = lasio.read(egfn("sample.las"))
18
    del las.curves['DT']
19
    assert las.curves.keys() == ['DEPT', 'RHOB', 'NPHI', 'SFLU', 'SFLA','ILM', 'ILD']
20
21
def test_delete_section_item_by_index():
22
    las = lasio.read(egfn('sample.las'))
23
    del las.params[1]
24
    assert las.params.keys() == ['BHT', 'FD', 'MATR', 'MDEN', 'RMF', 'DFD']
25
26
def test_delete_section_item_by_mnemonic():
27
    las = lasio.read(egfn('sample.las'))
28
    del las.params['MDEN']
29
    assert las.params.keys() == ['BHT', 'BS', 'FD', 'MATR', 'RMF', 'DFD']