summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Toso <me@victortoso.com>2015-05-02 00:01:16 +0200
committerJuan A. Suarez Romero <jasuarez@igalia.com>2015-09-06 16:13:54 +0200
commitd6be0f85e9f70996ecb0e800c80f109ca9957177 (patch)
tree0a1ed2de4fc21683b70b908aeea6767fe29a3b6f
parentdbfa6020275b5e8bd6c05c5048829bbd4b66f999 (diff)
downloadgrilo-plugins-d6be0f85e9f70996ecb0e800c80f109ca9957177.tar.gz
tests: thetvdb tests cache-only
cache-only test with empty database and with filled database but without network https://bugzilla.gnome.org/show_bug.cgi?id=748422
-rw-r--r--tests/thetvdb/test_thetvdb_resolve_shows.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/thetvdb/test_thetvdb_resolve_shows.c b/tests/thetvdb/test_thetvdb_resolve_shows.c
index 73691b2..8a73844 100644
--- a/tests/thetvdb/test_thetvdb_resolve_shows.c
+++ b/tests/thetvdb/test_thetvdb_resolve_shows.c
@@ -254,6 +254,27 @@ test_shows_normal(void)
test_shows (GRL_RESOLVE_NORMAL, FALSE);
}
+static void
+test_shows_fast_only_empty_db(void)
+{
+ test_reset_thetvdb ();
+ test_shows (GRL_RESOLVE_FAST_ONLY, TRUE);
+}
+
+static void
+test_shows_fast_only_full_db(void)
+{
+ gchar *mock = g_strdup (g_getenv ("GRL_NET_MOCKED"));
+ test_reset_thetvdb ();
+ /* Fill database */
+ test_shows (GRL_RESOLVE_NORMAL, FALSE);
+ /* Fail all web requests for cache-only test */
+ g_setenv ("GRL_NET_MOCKED", "/does/not/exist/config.ini", TRUE);
+ test_shows (GRL_RESOLVE_FAST_ONLY, FALSE);
+ g_setenv ("GRL_NET_MOCKED", mock, TRUE);
+ g_free (mock);
+}
+
gint
main (gint argc, gchar **argv)
{
@@ -271,6 +292,8 @@ main (gint argc, gchar **argv)
test_setup_thetvdb ();
g_test_add_func ("/thetvdb/resolve/normal/shows", test_shows_normal);
+ g_test_add_func ("/thetvdb/resolve/fast-only/empty-db/shows", test_shows_fast_only_empty_db);
+ g_test_add_func ("/thetvdb/resolve/fast-only/full-db/shows", test_shows_fast_only_full_db);
g_test_add_func ("/thetvdb/resolve/fuzzy-name-shows", test_shows_fuzzy_name);
gint result = g_test_run ();