From 16c47de61b2d4f28d9ce7397e8ea9eb5597038b6 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Mon, 17 Apr 2017 17:10:58 -0400 Subject: [PATCH] test_util.py: fully cover util.py --- src/wormhole/test/test_util.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/wormhole/test/test_util.py b/src/wormhole/test/test_util.py index 49117d7..ad3b8ad 100644 --- a/src/wormhole/test/test_util.py +++ b/src/wormhole/test/test_util.py @@ -1,5 +1,6 @@ from __future__ import unicode_literals import six +import mock import unicodedata from twisted.trial import unittest from .. import util @@ -48,3 +49,7 @@ class Space(unittest.TestCase): # some platforms (I think the VMs used by travis are in this # category) return 0, and windows will return None, so don't assert # anything more specific about the return value + + def test_no_statvfs(self): + with mock.patch("os.statvfs", side_effect=AttributeError()): + self.assertEqual(util.estimate_free_space("."), None)