Skip to content

Commit

Permalink
test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
kecnry committed Mar 7, 2024
1 parent 2d48c19 commit 20f1998
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lcviz/tests/test_plugin_ephemeris.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,24 @@ def test_cloned_phase_viewer(helper, light_curve_like_kepler_quarter):
helper.load_data(light_curve_like_kepler_quarter)
ephem = helper.plugins['Ephemeris']

assert len(ephem._get_phase_viewers()) == 0
pv1 = ephem.create_phase_viewer()
assert len(ephem._get_phase_viewers()) == 1
pv2 = pv1._obj.clone_viewer()
assert len(ephem._get_phase_viewers()) == 2
assert len(helper.viewers) == 3
assert pv1._obj.reference_id == 'flux-vs-phase:default'
assert pv1._obj._ephemeris_component == 'default'
assert pv2._obj.reference_id == 'flux-vs-phase:default[1]'
assert pv2._obj._ephemeris_component == 'default'

# renaming ephemeris should update both labels
ephem.rename_component('default', 'renamed')
assert pv1._obj.reference_id == 'flux-vs-phase:renamed'
assert pv1._obj._ephemeris_component == 'renamed'
assert pv2._obj.reference_id == 'flux-vs-phase:renamed[1]'
assert pv2._obj._ephemeris_component == 'renamed'
assert len(ephem._get_phase_viewers()) == 2

ephem.remove_component('renamed')
assert len(helper.viewers) == 1 # just flux-vs-phase

0 comments on commit 20f1998

Please sign in to comment.