Skip to content

Commit

Permalink
Add further tests, thanks @jlaehne
Browse files Browse the repository at this point in the history
  • Loading branch information
francisco-dlp committed Jun 16, 2022
1 parent 5651909 commit c66daa3
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion hyperspy/tests/axes/test_axes_manager.py
Expand Up @@ -20,7 +20,7 @@

import numpy as np

from hyperspy.axes import AxesManager, _serpentine_iter, _flyback_iter, GeneratorLen
from hyperspy.axes import AxesManager, _serpentine_iter, _flyback_iter, GeneratorLen, BaseDataAxis
from hyperspy.defaults_parser import preferences
from hyperspy.signals import BaseSignal, Signal1D, Signal2D

Expand Down Expand Up @@ -114,6 +114,16 @@ def test_all_uniform(self):
self.am[-1].convert_to_non_uniform_axis()
assert self.am.all_uniform == False

def test_get_axis(self):
am = self.am
assert am[0] == am["d"]
assert am[-1] == am["b"]
axis = am[1]
assert am[axis] == axis
with pytest.raises(ValueError):
axis = BaseDataAxis()
am[axis]


class TestAxesManagerScaleOffset:
def test_low_high_value(self):
Expand Down

0 comments on commit c66daa3

Please sign in to comment.