MCPcopy Index your code
hub / github.com/streamlit/streamlit / test_basic

Method test_basic

lib/tests/streamlit/elements/map_test.py:49–63  ·  view source on GitHub ↗

Test that it can be called with lat/lon.

(self)

Source from the content-addressed store, hash-verified

47 assert json.loads(c.json) == _DEFAULT_MAP
48
49 def test_basic(self):
50 """Test that it can be called with lat/lon."""
51 st.map(mock_df)
52
53 c = json.loads(self.get_delta_from_queue().new_element.deck_gl_json_chart.json)
54
55 assert c.get("initialViewState") is not None
56 assert c.get("layers") is not None
57 assert c.get("mapStyle") is None
58 assert len(c.get("layers")) == 1
59 assert c.get("initialViewState").get("latitude") == 2.5
60 assert c.get("initialViewState").get("longitude") == 25
61 assert c.get("initialViewState").get("zoom") == 3
62 assert c.get("initialViewState").get("pitch") == 0
63 assert c.get("layers")[0].get("@@type") == "ScatterplotLayer"
64
65 def test_alternative_names_columns(self):
66 """Test that it can be called with alternative names of lat/lon columns."""

Callers

nothing calls this directly

Calls 3

mapMethod · 0.80
get_delta_from_queueMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected