summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Toso <me@victortoso.com>2015-05-02 00:01:16 +0200
committerVictor Toso <me@victortoso.com>2015-08-29 17:36:45 +0200
commit9b67d69d47392e7ee74d3cb28098aa8edb5215b9 (patch)
treed852cbbba2d9a02d6fe2282d151cc68331f060d8
parent9169323f1d4b8706252fed9971353182cd44c16d (diff)
downloadgrilo-plugins-9b67d69d47392e7ee74d3cb28098aa8edb5215b9.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 ();