1010
1111from ginga .ColorDist import ColorDistBase
1212
13- from ..core import ImageWidget , ALLOWED_CURSOR_LOCATIONS
13+ from ..ginga import ImageWidget , ALLOWED_CURSOR_LOCATIONS
1414
1515
16- def test_load_fits ():
16+ def test_load_fits (): # yep
1717 image = ImageWidget ()
1818 data = np .random .random ([100 , 100 ])
1919 hdu = fits .PrimaryHDU (data = data )
2020 image .load_fits (hdu )
2121
2222
23- def test_load_nddata ():
23+ def test_load_nddata (): # yep
2424 image = ImageWidget ()
2525 data = np .random .random ([100 , 100 ])
2626 nddata = NDData (data )
2727 image .load_nddata (nddata )
2828
2929
30- def test_load_array ():
30+ def test_load_array (): # yep
3131 image = ImageWidget ()
3232 data = np .random .random ([100 , 100 ])
3333 image .load_array (data )
3434
3535
36- def test_center_on ():
36+ def test_center_on (): # yep
3737 image = ImageWidget ()
3838 x = 10
3939 y = 10
@@ -48,7 +48,7 @@ def test_offset_to():
4848 image .offset_to (dx , dy )
4949
5050
51- def test_offset_by ():
51+ def test_offset_by (): # yep
5252 image = ImageWidget ()
5353
5454 # Pixels
@@ -66,48 +66,48 @@ def test_offset_by():
6666 image .offset_by (1 * u .arcsec , 1 )
6767
6868
69- def test_zoom_level ():
69+ def test_zoom_level (): # yep
7070 image = ImageWidget ()
7171 image .zoom_level = 5
7272 assert image .zoom_level == 5
7373
7474
75- def test_zoom ():
75+ def test_zoom (): # yep
7676 image = ImageWidget ()
7777 image .zoom_level = 3
7878 val = 2
7979 image .zoom (val )
8080 assert image .zoom_level == 6
8181
8282
83- @pytest .mark .xfail (reason = 'Not implemented yet' )
83+ @pytest .mark .xfail (reason = 'Not implemented yet' ) # Nope, note even sure what this is
8484def test_select_points ():
8585 image = ImageWidget ()
8686 image .select_points ()
8787
8888
89- def test_get_selection ():
89+ def test_get_selection (): # Um, how is this testing a selection?!?
9090 image = ImageWidget ()
9191 marks = image .get_markers ()
9292 assert isinstance (marks , Table ) or marks is None
9393
9494
95- def test_stop_marking ():
95+ def test_stop_marking (): # In test_marking_options
9696 image = ImageWidget ()
9797 # This is not much of a test...
9898 image .stop_marking (clear_markers = True )
9999 assert image .get_markers () is None
100100 assert image .is_marking is False
101101
102102
103- def test_is_marking ():
103+ def test_is_marking (): # In test_marking_options
104104 image = ImageWidget ()
105105 assert image .is_marking in [True , False ]
106106 with pytest .raises (AttributeError ):
107107 image .is_marking = True
108108
109109
110- def test_start_marking ():
110+ def test_start_marking (): # In test_marking_options
111111 image = ImageWidget ()
112112
113113 # Setting these to check that start_marking affects them.
@@ -142,23 +142,23 @@ def test_start_marking():
142142 assert image .click_drag
143143
144144
145- def test_add_markers ():
145+ def test_add_markers (): # In test_marking_options
146146 image = ImageWidget ()
147147 table = Table (data = np .random .randint (0 , 100 , [5 , 2 ]),
148148 names = ['x' , 'y' ], dtype = ('int' , 'int' ))
149149 image .add_markers (table , x_colname = 'x' , y_colname = 'y' ,
150150 skycoord_colname = 'coord' )
151151
152152
153- def test_set_markers ():
153+ def test_set_markers (): # In test_marking_options
154154 image = ImageWidget ()
155155 image .marker = {'color' : 'yellow' , 'radius' : 10 , 'type' : 'cross' }
156156 assert 'cross' in str (image .marker )
157157 assert 'yellow' in str (image .marker )
158158 assert '10' in str (image .marker )
159159
160160
161- def test_reset_markers ():
161+ def test_reset_markers (): # In test_marking_options
162162 image = ImageWidget ()
163163 # First test: this shouldn't raise any errors
164164 # (it also doesn't *do* anything...)
@@ -177,7 +177,7 @@ def test_reset_markers():
177177 image .get_markers (marker_name = 'test2' )
178178
179179
180- def test_remove_markers ():
180+ def test_remove_markers (): # In test_marking_options
181181 image = ImageWidget ()
182182 # Add a tag name...
183183 image ._marktags .add (image ._default_mark_tag_name )
@@ -186,7 +186,7 @@ def test_remove_markers():
186186 assert 'arf' in str (e .value )
187187
188188
189- def test_stretch ():
189+ def test_stretch (): # yep
190190 image = ImageWidget ()
191191 with pytest .raises (ValueError ) as e :
192192 image .stretch = 'not a valid value'
@@ -196,7 +196,7 @@ def test_stretch():
196196 assert isinstance (image .stretch , (ColorDistBase ))
197197
198198
199- def test_cuts ():
199+ def test_cuts (): # yep
200200 image = ImageWidget ()
201201
202202 # An invalid string should raise an error
@@ -219,7 +219,7 @@ def test_cuts():
219219 assert image .cuts == (10 , 100 )
220220
221221
222- def test_colormap ():
222+ def test_colormap (): # yep
223223 image = ImageWidget ()
224224 cmap_desired = 'gray'
225225 cmap_list = image .colormap_options
@@ -228,7 +228,7 @@ def test_colormap():
228228 image .set_colormap (cmap_desired )
229229
230230
231- def test_cursor ():
231+ def test_cursor (): # yep
232232 image = ImageWidget ()
233233 assert image .cursor in ALLOWED_CURSOR_LOCATIONS
234234 with pytest .raises (ValueError ):
@@ -237,7 +237,7 @@ def test_cursor():
237237 assert image .cursor == 'bottom'
238238
239239
240- def test_click_drag ():
240+ def test_click_drag (): # yep
241241 image = ImageWidget ()
242242 # Set this to ensure that click_drag turns it off
243243 image ._click_center = True
@@ -260,7 +260,7 @@ def test_click_drag():
260260 assert 'Interactive marking' in str (e .value )
261261
262262
263- def test_click_center ():
263+ def test_click_center (): # yep
264264 image = ImageWidget ()
265265 assert (image .click_center is True ) or (image .click_center is False )
266266
@@ -283,7 +283,7 @@ def test_click_center():
283283 image .click_center = False
284284
285285
286- def test_scroll_pan ():
286+ def test_scroll_pan (): # yep
287287 image = ImageWidget ()
288288
289289 # Make sure scroll_pan is actually settable
@@ -292,13 +292,13 @@ def test_scroll_pan():
292292 assert image .scroll_pan is val
293293
294294
295- def test_save (tmp_path ):
295+ def test_save (tmp_path ): # yep
296296 image = ImageWidget ()
297297 filename = 'woot.png'
298298 image .save (tmp_path / filename )
299299
300300
301- def test_width_height ():
301+ def test_width_height (): # yep
302302 image = ImageWidget (image_width = 250 , image_height = 100 )
303303 assert image .image_width == 250
304304 assert image .image_height == 100
0 commit comments