Skip to content

Commit

Permalink
test case for LinearLocator
Browse files Browse the repository at this point in the history
  • Loading branch information
git-abhishek committed Jun 25, 2018
1 parent f32e3b7 commit 06a0c39
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions yt/visualization/tests/test_tick_locators.py
@@ -0,0 +1,19 @@
import numpy as np

from yt.testing import assert_equal
from yt.visualization.tick_locators import LinearLocator


def test_linear_locator():
preset = {(-1.5e-10, 2.3e-10): np.linspace(-1.5e-10, 2.3e-10, 7)}
loc = LinearLocator(numticks=10, presets=preset)
desired = np.linspace(-1.2, 2.5, 10)
assert_equal(loc(-1.2, 2.5), desired)
assert_equal(loc(2.5, -1.2), desired)

desired = np.linspace(-1.5e-10, 2.3e-10, 7)
assert_equal(loc(-1.5e-10, 2.3e-10), desired)
assert_equal(loc(2.3e-10, -1.5e-10), desired)

def test_log_locator():
pass

0 comments on commit 06a0c39

Please sign in to comment.