Write a small Streamlit dashboard and an automated test for it, in one program. Standard input is the CSV date,district,pm25.
The dashboard (a Streamlit script, run with AppTest.from_string with the CSV embedded as a string): title CityPulse air quality; a selectbox "District" with sorted districts; two metrics in two columns — Latest PM2.5 (the last value, with delta = last − previous formatted :+g, delta_color="inverse") and Days above 35 (count of values > 35); an Altair line chart; a caption 4 days, data up to 2026-03-04.
The test prints title: …, options: [...], then for each option (after set_value(...).run()): Lucheng: Latest PM2.5 = 48 (delta -13), Days above 35 = 4 | 4 days, data up to 2026-03-04, and finally exceptions: 0. Silence Streamlit's "missing ScriptRunContext" warning with logging.