Skip to content

Commit

Permalink
Properly compare autocenter coord values as floats
Browse files Browse the repository at this point in the history
  • Loading branch information
duytnguyendtn committed Jul 24, 2024
1 parent 4f3a967 commit a18101c
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from numpy.testing import assert_allclose
import pytest

from jdaviz.configs.imviz.tests.utils import BaseImviz_WCS_WCS
Expand Down Expand Up @@ -33,11 +34,15 @@ def test_autocenter_coords(self):

# Switch to first viewer and verify coordinates have switched
vo_plugin.viewer_selected = "imviz-0"
assert vo_plugin.source == "337.51894336761296 -20.832083054811765"
ra_str, dec_str = vo_plugin.source.split()
assert_allclose(float(ra_str), 337.51894336761296)
assert_allclose(float(dec_str), -20.832083054811765)

# Switch to second viewer and verify coordinates
vo_plugin.viewer_selected = "imviz-1"
assert vo_plugin.source == "337.51924057481 -20.83208305686149"
ra_str, dec_str = vo_plugin.source.split()
assert_allclose(float(ra_str), 337.51924057481)
assert_allclose(float(dec_str), -20.83208305686149)

def test_populate_table_default_headers(self):
"""
Expand Down

0 comments on commit a18101c

Please sign in to comment.