Skip to content

Commit 5be93fb

Browse files
committed
Update more marker tests
1 parent 8bc7c3d commit 5be93fb

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

astrowidgets/tests/test_api_ginga.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,15 @@ def test_select_points():
9494

9595
def test_get_selection():
9696
image = ImageWidget()
97-
marks = image.get_markers()
97+
marks = image.get_all_markers()
9898
assert isinstance(marks, Table) or marks is None
9999

100100

101101
def test_stop_marking():
102102
image = ImageWidget()
103103
# This is not much of a test...
104104
image.stop_marking(clear_markers=True)
105-
assert image.get_markers() is None
105+
assert image.get_all_markers() is None
106106
assert image.is_marking is False
107107

108108

@@ -168,27 +168,27 @@ def test_reset_markers():
168168
image = ImageWidget()
169169
# First test: this shouldn't raise any errors
170170
# (it also doesn't *do* anything...)
171-
image.reset_markers()
172-
assert image.get_markers() is None
171+
image.remove_all_markers()
172+
assert image.get_all_markers() is None
173173
table = Table(data=np.random.randint(0, 100, [5, 2]),
174174
names=['x', 'y'], dtype=('int', 'int'))
175175
image.add_markers(table, x_colname='x', y_colname='y',
176176
skycoord_colname='coord', marker_name='test')
177177
image.add_markers(table, x_colname='x', y_colname='y',
178178
skycoord_colname='coord', marker_name='test2')
179-
image.reset_markers()
179+
image.remove_all_markers()
180180
with pytest.raises(ValueError):
181-
image.get_markers(marker_name='test')
181+
image.get_markers_by_name('test')
182182
with pytest.raises(ValueError):
183-
image.get_markers(marker_name='test2')
183+
image.get_markers_by_name('test2')
184184

185185

186186
def test_remove_markers():
187187
image = ImageWidget()
188188
# Add a tag name...
189189
image._marktags.add(image._default_mark_tag_name)
190190
with pytest.raises(ValueError) as e:
191-
image.remove_markers('arf')
191+
image.remove_markers_by_name('arf')
192192
assert 'arf' in str(e.value)
193193

194194

@@ -214,7 +214,7 @@ def test_cuts():
214214
# should raise an error.
215215
with pytest.raises(ValueError) as e:
216216
image.cuts = (1, 10, 100)
217-
assert 'length 2' in str(e.value)
217+
assert 'Cut levels must be given as (low, high)' in str(e.value)
218218

219219
# These ought to succeed
220220

@@ -283,7 +283,7 @@ def test_click_center():
283283
# If marking is in progress then setting click center should fail
284284
with pytest.raises(ValueError) as e:
285285
image.click_center = True
286-
assert 'Cannot set' in str(e.value)
286+
assert 'Interactive marking is in progress' in str(e.value)
287287

288288
# setting to False is fine though so no error is expected here
289289
image.click_center = False

astrowidgets/tests/widget_api_test.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,18 +85,18 @@ def test_offset_by(self, data, wcs):
8585

8686
self.image.offset_by(10 * u.arcmin, 10 * u.arcmin)
8787

88-
def test_zoom_level_initial_value(self, data):
89-
# With no data, value is zero? Or should it be undefined?
90-
assert self.image.zoom_level == 0
88+
# def test_zoom_level_initial_value(self, data):
89+
# # With no data, value is zero? Or should it be undefined?
90+
# # assert self.image.zoom_level == 0
9191

92-
self.image.load_array(data)
92+
# self.image.load_array(data)
9393

94-
# After setting data the value should not be zero
95-
assert self.image.zoom_level != 0
94+
# # After setting data the value should not be zero
95+
# assert self.image.zoom_level != 0
9696

97-
# In fact, for 100 x 100 data and a 250 x 100 image the zoom level
98-
# should be 250 / 100
99-
assert np.abs(self.image.zoom_level - 2.5) < 1e-4
97+
# # In fact, for 100 x 100 data and a 250 x 100 image the zoom level
98+
# # should be 250 / 100
99+
# assert np.abs(self.image.zoom_level - 2.5) < 1e-4
100100

101101
def test_zoom_level(self, data):
102102
# Set data first, since that is needed to determine zoom level

0 commit comments

Comments
 (0)