added test_plot_constant_model function
@@ -15,7 +15,7 @@ from gammapy.modeling.models import (
SkyModel,
)
from gammapy.utils.scripts import make_path
-from gammapy.utils.testing import requires_data
+from gammapy.utils.testing import requires_data, requires_dependency, mpl_plot_check
# TODO: add light-curve test case from scratch
@@ -209,3 +209,12 @@ def test_with_skymodel(light_curve):
out = sky_model.to_dict()
assert "temporal" in out
+
+
+@requires_dependency("matplotlib")
+def test_plot_constant_model():
+ time_range = [Time.now(), Time.now() + 1 * u.d]
+ constant_model = ConstantTemporalModel(const=1)
+ with mpl_plot_check():
+ constant_model.plot(time_range)
+
