From 5a33e5eee9610a81b26ed942c0af3f1d8af4f0f2 Mon Sep 17 00:00:00 2001
From: Martijn Vermaat <martijn@vermaat.name>
Date: Wed, 27 Jul 2011 15:18:21 +0000
Subject: [PATCH] Fix for getCache webservice.

git-svn-id: https://humgenprojects.lumc.nl/svn/mutalyzer/branches/gbinfo-sync-branch@320 eb6bd6ab-9ccd-42b9-aceb-e2899b4a52f1
---
 mutalyzer/util.py        | 6 +++++-
 tests/test_webservice.py | 9 ++++++---
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/mutalyzer/util.py b/mutalyzer/util.py
index 8aecc08c..180f179c 100644
--- a/mutalyzer/util.py
+++ b/mutalyzer/util.py
@@ -749,7 +749,11 @@ def monkey_patch_suds():
     for the XML namespace, but the W3C seems to respond too slow on that url.
     We therefore use http://www.w3.org/2009/01/xml.xsd which fixes this.
 
-    Call this function before importing anything from the suds package.
+    Call this function before importing anything from the suds package. For
+    example, start your file with the following:
+
+        import monkey; monkey.monkey_patch_suds()
+        from suds.client import Client
     """
     from suds.xsd.sxbasic import Import
     _import_open = Import.open
diff --git a/tests/test_webservice.py b/tests/test_webservice.py
index dd0dc3e6..5052cb4a 100644
--- a/tests/test_webservice.py
+++ b/tests/test_webservice.py
@@ -9,6 +9,7 @@ import os
 from datetime import datetime, timedelta
 import mutalyzer
 from mutalyzer.config import Config
+from mutalyzer.output import Output
 from mutalyzer.sync import CacheSync
 from mutalyzer import Db
 import logging; logging.raiseExceptions = 0
@@ -165,13 +166,15 @@ class TestWebservice():
 
     def test_getcache(self):
         """
-        Running the getCache method should give us the expected cache entries.
+        Running the getCache method should give us the expected number of
+        cache entries.
         """
-        created_since = datetime.today() - timedelta(days=60)
+        created_since = datetime.today() - timedelta(days=14)
 
         config = Config()
         database = Db.Cache(config.Db)
-        sync = CacheSync(config.Sync, database)
+        output = Output(__file__, config.Output)
+        sync = CacheSync(config.Retriever, output, database)
         cache = sync.local_cache(created_since)
 
         r = self.client.service.getCache(created_since)
-- 
GitLab