Skip to content

Commit

Permalink
Increase test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
jfoster17 committed Mar 20, 2024
1 parent 4475ffb commit 4fda1e4
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions glue/viewers/image/tests/test_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,39 @@ def setup_method(self, method):

self.viewer = self.application.new_data_viewer(SimpleImageViewer)

def test_wcs_viewer_bad_link(self):
self.viewer.add_data(self.image1)

link1 = LinkSame(self.region_data.id['color'], self.image1.world_component_ids[1])
link2 = LinkSame(self.region_data.id['area'], self.image1.world_component_ids[0])

self.application.data_collection.add_link(link1)
self.application.data_collection.add_link(link2)

self.viewer.add_data(self.region_data)

assert self.viewer.state._display_world is True
assert len(self.viewer.state.layers) == 2
assert self.viewer.layers[0].enabled
assert not self.viewer.layers[1].enabled

def test_wcs_viewer_good_link(self):
self.viewer.add_data(self.image1)

link1 = LinkSame(self.region_data.center_x_id, self.image1.world_component_ids[1])
link2 = LinkSame(self.region_data.center_y_id, self.image1.world_component_ids[0])

self.application.data_collection.add_link(link1)
self.application.data_collection.add_link(link2)

self.viewer.add_data(self.region_data)

assert self.viewer.state._display_world is True
assert len(self.viewer.state.layers) == 2
assert self.viewer.layers[0].enabled
assert self.viewer.layers[1].enabled


@visual_test
def test_wcs_viewer(self):
self.viewer.add_data(self.image1)
Expand Down

0 comments on commit 4fda1e4

Please sign in to comment.