From 790f44b9b150b78e987e0d66a1cdc59cdd28730d Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Mon, 20 Jun 2005 19:11:31 +0000 Subject: [PATCH] Check need_download() can return True. git-svn-id: file:///home/talex/Backups/sf.net/Subversion/zero-install/injector/injector@359 9f8c893c-44ee-0310-b757-c8ca8341c71e --- tests/testautopolicy.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/testautopolicy.py b/tests/testautopolicy.py index 00b7015..9f4f70e 100755 --- a/tests/testautopolicy.py +++ b/tests/testautopolicy.py @@ -81,6 +81,23 @@ class TestAutoPolicy(unittest.TestCase): except model.SafeException, ex: assert "ThisBetterNotExist" in str(ex) + def testNeedDL(self): + policy = autopolicy.AutoPolicy(foo_iface_uri, False, False) + policy.freshness = 1 + policy.network_use = model.network_full + self.cache_iface(foo_iface_uri, +""" + + Foo + Foo + Foo + +""" % foo_iface_uri) + assert policy.need_download() + suite = unittest.makeSuite(TestAutoPolicy) if __name__ == '__main__': sys.argv.append('-v') -- 2.11.4.GIT