astrolabsoftware / fink-science-portal

Fink Science Portal
https://fink-portal.org
Apache License 2.0
7 stars 4 forks source link

Datesearch: test broken #550

Closed JulienPeloton closed 8 months ago

JulienPeloton commented 8 months ago

Recent log:

./api_datesearch_test.py
**********************************************************************
File "./api_datesearch_test.py", line 66, in __main__.test_bad_datesearch
Failed example:
    test_bad_datesearch()
Exception raised:
    Traceback (most recent call last):
      File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/doctest.py", line 1337, in __run
        compileflags, 1), test.globs)
      File "<doctest __main__.test_bad_datesearch[0]>", line 1, in <module>
        test_bad_datesearch()
      File "./api_datesearch_test.py", line 82, in test_bad_datesearch
        assert r.text == str(msg)
    AssertionError
**********************************************************************
File "./api_datesearch_test.py", line 52, in __main__.test_simple_datesearch
Failed example:
    test_simple_datesearch()
Exception raised:
    Traceback (most recent call last):
      File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/doctest.py", line 1337, in __run
        compileflags, 1), test.globs)
      File "<doctest __main__.test_simple_datesearch[0]>", line 1, in <module>
        test_simple_datesearch()
      File "./api_datesearch_test.py", line 58, in test_simple_datesearch
        assert len(pdf) == 407, len(pdf)
    AssertionError: 996
JulienPeloton commented 8 months ago

Note that with recent change (see #541 ), the parameter window for datesearch (only) is restricted to maximum 3 hours. Test should reflect this, and this threshold should be documented in the API.

karpov-sv commented 8 months ago

Yes, simple test fails because it is now in days, not minutes - it is easy to fix. The second one is trickier - now the API does not provide an error message, but just crops the window to 3 hours if it is larger than that. Is it correct behaviour, or we should return the error in this case instead?..

JulienPeloton commented 8 months ago

Fixed in https://github.com/astrolabsoftware/fink-science-portal/pull/557