From 97fc00e8f5516918f9c22593385f205a5894b726 Mon Sep 17 00:00:00 2001 From: Alexander Piskun Date: Thu, 26 Sep 2024 22:03:55 +0300 Subject: [PATCH] fixed randomly failing CI in AppAPI Signed-off-by: Alexander Piskun --- tests/actual_tests/weather_status_test.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/actual_tests/weather_status_test.py b/tests/actual_tests/weather_status_test.py index a56740bf..fe8dcf4e 100644 --- a/tests/actual_tests/weather_status_test.py +++ b/tests/actual_tests/weather_status_test.py @@ -13,7 +13,12 @@ async def test_available_async(anc): def test_get_set_location(nc_any): - nc_any.weather_status.set_location(longitude=0.0, latitude=0.0) + try: + nc_any.weather_status.set_location(longitude=0.0, latitude=0.0) + except NextcloudException as e: + if e.status_code in (408, 500, 996): + pytest.skip("Some network problem on the host") + raise e from None loc = nc_any.weather_status.get_location() assert loc.latitude == 0.0 assert loc.longitude == 0.0 @@ -42,7 +47,12 @@ def test_get_set_location(nc_any): @pytest.mark.asyncio(scope="session") async def test_get_set_location_async(anc_any): - await anc_any.weather_status.set_location(longitude=0.0, latitude=0.0) + try: + await anc_any.weather_status.set_location(longitude=0.0, latitude=0.0) + except NextcloudException as e: + if e.status_code in (408, 500, 996): + pytest.skip("Some network problem on the host") + raise e from None loc = await anc_any.weather_status.get_location() assert loc.latitude == 0.0 assert loc.longitude == 0.0