Spaces:
Running
Running
rmm
commited on
Commit
·
2e11215
1
Parent(s):
21b4fff
fix: test_two_input_files_realdata passing
Browse files- note: asymmetry between lat/lon vs date/time; the latter pair need
their values going via the cache too
src/input/input_handling.py
CHANGED
@@ -250,7 +250,7 @@ def metadata_inputs_one_file(file:UploadedFile, image_hash:str, dbg_ix:int=0) ->
|
|
250 |
"Latitude for " + filename,
|
251 |
latitude0,
|
252 |
disabled=st.session_state.get("input_disabled", False),
|
253 |
-
|
254 |
)
|
255 |
if latitude and not is_valid_number(latitude):
|
256 |
viewcontainer.error("Please enter a valid latitude (numerical only).")
|
@@ -260,7 +260,7 @@ def metadata_inputs_one_file(file:UploadedFile, image_hash:str, dbg_ix:int=0) ->
|
|
260 |
"Longitude for " + filename,
|
261 |
longitude0,
|
262 |
disabled=st.session_state.get("input_disabled", False),
|
263 |
-
|
264 |
)
|
265 |
if longitude and not is_valid_number(longitude):
|
266 |
viewcontainer.error("Please enter a valid longitude (numerical only).")
|
|
|
250 |
"Latitude for " + filename,
|
251 |
latitude0,
|
252 |
disabled=st.session_state.get("input_disabled", False),
|
253 |
+
key=f"input_latitude_anchor_{image_hash}",
|
254 |
)
|
255 |
if latitude and not is_valid_number(latitude):
|
256 |
viewcontainer.error("Please enter a valid latitude (numerical only).")
|
|
|
260 |
"Longitude for " + filename,
|
261 |
longitude0,
|
262 |
disabled=st.session_state.get("input_disabled", False),
|
263 |
+
key=f"input_longitude_anchor_{image_hash}",
|
264 |
)
|
265 |
if longitude and not is_valid_number(longitude):
|
266 |
viewcontainer.error("Please enter a valid longitude (numerical only).")
|
tests/test_demo_input_sidebar.py
CHANGED
@@ -262,8 +262,8 @@ def test_two_input_files_realdata(mock_file_rv: MagicMock, mock_uploadedFile_Lis
|
|
262 |
# and then there are plenty of visual elements, based on the image hashes.
|
263 |
for hash in at.session_state.image_hashes:
|
264 |
# check that each of the 4 inputs is present
|
265 |
-
assert at.sidebar.text_input(key=f"
|
266 |
-
assert at.sidebar.text_input(key=f"
|
267 |
assert at.sidebar.date_input(key=f"input_date_{hash}") is not None
|
268 |
assert at.sidebar.time_input(key=f"input_time_{hash}") is not None
|
269 |
|
|
|
262 |
# and then there are plenty of visual elements, based on the image hashes.
|
263 |
for hash in at.session_state.image_hashes:
|
264 |
# check that each of the 4 inputs is present
|
265 |
+
assert at.sidebar.text_input(key=f"input_latitude_anchor_{hash}") is not None
|
266 |
+
assert at.sidebar.text_input(key=f"input_longitude_anchor_{hash}") is not None
|
267 |
assert at.sidebar.date_input(key=f"input_date_{hash}") is not None
|
268 |
assert at.sidebar.time_input(key=f"input_time_{hash}") is not None
|
269 |
|