summaryrefslogtreecommitdiff
path: root/dev-libs/libgweather/files/3.36.1-autoskip-network-test.patch
blob: d6b3d2f61313c4717cf334688dd884b6fb8318da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From f2bacee194ce58aabf5a08752556177bda6ab570 Mon Sep 17 00:00:00 2001
From: Mart Raudsepp <leio@gentoo.org>
Date: Sun, 30 Aug 2020 10:35:13 +0300
Subject: [PATCH] tests: Skip metar tests when METAR_SOURCES couldn't be
 resolved

---
 libgweather/test_libgweather.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libgweather/test_libgweather.c b/libgweather/test_libgweather.c
index 8a21911..ef401f8 100644
--- a/libgweather/test_libgweather.c
+++ b/libgweather/test_libgweather.c
@@ -419,6 +419,12 @@ test_metar_weather_stations (void)
     msg = soup_message_new ("GET", METAR_SOURCES);
     session = soup_session_new ();
     soup_session_send_message (session, msg);
+    if (msg->status_code == SOUP_STATUS_CANT_RESOLVE) {
+        g_test_skip ("Could not resolve " METAR_SOURCES " - network sandboxed?");
+        g_object_unref (session);
+        g_object_unref (msg);
+        return;
+    }
     g_assert (SOUP_STATUS_IS_SUCCESSFUL (msg->status_code));
     g_object_unref (session);
     g_assert_nonnull (msg->response_body);
-- 
2.20.1