Skip to content

Commit 7e42dbd

Browse files
Merge branch 'codefixes' of https://github.com/sudhanshu112233shukla/grass into codefixes
2 parents 420720a + 052f1b2 commit 7e42dbd

File tree

1 file changed

+25
-14
lines changed

1 file changed

+25
-14
lines changed

temporal/testsuite/test_timeseriesmap.py

+25-14
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,33 @@
22
from grass.jupyter import TimeSeriesMap
33

44
def test_timeseriesmap_render():
5-
"""Test if TimeSeriesMap renders layers correctly."""
6-
7-
# Create TimeSeriesMap instance
5+
"""Test if TimeSeriesMap renders layers, overlays, and legends correctly."""
6+
7+
# Create instance
88
precip_map = TimeSeriesMap(use_region=True)
9-
9+
1010
# Add raster series
1111
precip_map.add_raster_series("precip_sum_2018")
12-
13-
# Add overlays (Legend, Boundary, and Scale bar)
14-
precip_map.d_legend(color="black", at=(10, 40, 2, 6))
12+
13+
# Add overlays (boundary, scalebar, legend)
1514
precip_map.d_vect(map="boundary_country", fill_color="none")
1615
precip_map.d_barscale()
17-
18-
# Render the map
19-
precip_map.show()
20-
21-
# Assert that the map object has layers
22-
assert precip_map._layers is not None
23-
assert len(precip_map._layers) > 0
16+
precip_map.d_legend(color="black", at=(10, 40, 2, 6))
17+
18+
# Render frames (headless)
19+
precip_map.render()
20+
21+
# Verify layers
22+
assert precip_map._layers is not None, "No layers loaded"
23+
assert len(precip_map._layers) > 0, "Layers list is empty"
24+
25+
# Verify overlays (d_vect and d_barscale)
26+
assert len(precip_map._base_calls) >= 2, (
27+
f"Expected ≥2 overlay calls, got {len(precip_map._base_calls)}"
28+
)
29+
30+
# Verify legend
31+
assert precip_map._legend == {
32+
"color": "black",
33+
"at": (10, 40, 2, 6),
34+
}, "Legend not configured correctly"

0 commit comments

Comments
 (0)