test_util.py: fully cover util.py
This commit is contained in:
parent
556ae663cb
commit
16c47de61b
|
@ -1,5 +1,6 @@
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import six
|
import six
|
||||||
|
import mock
|
||||||
import unicodedata
|
import unicodedata
|
||||||
from twisted.trial import unittest
|
from twisted.trial import unittest
|
||||||
from .. import util
|
from .. import util
|
||||||
|
@ -48,3 +49,7 @@ class Space(unittest.TestCase):
|
||||||
# some platforms (I think the VMs used by travis are in this
|
# some platforms (I think the VMs used by travis are in this
|
||||||
# category) return 0, and windows will return None, so don't assert
|
# category) return 0, and windows will return None, so don't assert
|
||||||
# anything more specific about the return value
|
# 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)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user