From 8797c3ce1b12ce60e1f94b9ae45fea03f566e516 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Wed, 18 Aug 2010 12:15:16 -0700 Subject: [PATCH] Add additional test for get_torrents_status and fix the other one to properly invalidate the cache time from startup before proceeding --- tests/test_sessionproxy.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_sessionproxy.py b/tests/test_sessionproxy.py index d0e051e3d..bc336c6c1 100644 --- a/tests/test_sessionproxy.py +++ b/tests/test_sessionproxy.py @@ -112,8 +112,17 @@ class SessionProxyTestCase(unittest.TestCase): return d def test_get_torrent_status_key_not_updated(self): + time.sleep(self.sp.cache_time + 0.1) self.sp.get_torrent_status("a", ["key1"]) client.core.torrents["a"]["key2"] = 99 d = self.sp.get_torrent_status("a", ["key2"]) d.addCallback(self.assertEquals, {"key2": 99}) return d + + def test_get_torrents_status_key_not_updated(self): + time.sleep(self.sp.cache_time + 0.1) + self.sp.get_torrents_status({"id": ["a"]}, ["key1"]) + client.core.torrents["a"]["key2"] = 99 + d = self.sp.get_torrents_status({"id": ["a"]}, ["key2"]) + d.addCallback(self.assertEquals, {"a": {"key2": 99}}) + return d