Code Duplication    Length = 7-8 lines in 3 locations

metpy/plots/tests/test_ctables.py 3 locations

@@ 85-92 (lines=8) @@
82
    assert table.colors == true_colors
83
84
85
def test_get_steps(registry):
86
    """Test getting a colortable and norm with appropriate steps."""
87
    registry['table'] = [(0.0, 0.0, 1.0), (1.0, 0.0, 0.0), (0.0, 1.0, 0.0)]
88
    norm, cmap = registry.get_with_steps('table', 5., 10.)
89
    assert cmap(norm(np.array([6.]))).tolist() == [[0.0, 0.0, 1.0, 1.0]]
90
    assert cmap(norm(np.array([14.9]))).tolist() == [[0.0, 0.0, 1.0, 1.0]]
91
    assert cmap(norm(np.array([15.1]))).tolist() == [[1.0, 0.0, 0.0, 1.0]]
92
    assert cmap(norm(np.array([26.]))).tolist() == [[0.0, 1.0, 0.0, 1.0]]
93
94
95
def test_get_steps_negative_start(registry):
@@ 103-109 (lines=7) @@
100
    assert norm.vmax == 5
101
102
103
def test_get_range(registry):
104
    """Test getting a colortable and norm with appropriate range."""
105
    registry['table'] = [(0.0, 0.0, 1.0), (1.0, 0.0, 0.0), (0.0, 1.0, 0.0)]
106
    norm, cmap = registry.get_with_range('table', 5., 35.)
107
    assert cmap(norm(np.array([6.]))).tolist() == [[0.0, 0.0, 1.0, 1.0]]
108
    assert cmap(norm(np.array([14.9]))).tolist() == [[0.0, 0.0, 1.0, 1.0]]
109
    assert cmap(norm(np.array([15.1]))).tolist() == [[1.0, 0.0, 0.0, 1.0]]
110
    assert cmap(norm(np.array([26.]))).tolist() == [[0.0, 1.0, 0.0, 1.0]]
111
112
@@ 103-110 (lines=8) @@
100
    assert norm.vmax == 5
101
102
103
def test_get_range(registry):
104
    """Test getting a colortable and norm with appropriate range."""
105
    registry['table'] = [(0.0, 0.0, 1.0), (1.0, 0.0, 0.0), (0.0, 1.0, 0.0)]
106
    norm, cmap = registry.get_with_range('table', 5., 35.)
107
    assert cmap(norm(np.array([6.]))).tolist() == [[0.0, 0.0, 1.0, 1.0]]
108
    assert cmap(norm(np.array([14.9]))).tolist() == [[0.0, 0.0, 1.0, 1.0]]
109
    assert cmap(norm(np.array([15.1]))).tolist() == [[1.0, 0.0, 0.0, 1.0]]
110
    assert cmap(norm(np.array([26.]))).tolist() == [[0.0, 1.0, 0.0, 1.0]]
111
112
113
def test_get_boundaries(registry):