diff options
| author | hchiramm <hchiramm@redhat.com> | 2014-04-09 18:48:28 +0530 | 
|---|---|---|
| committer | hchiramm <hchiramm@redhat.com> | 2014-05-02 18:05:29 +0530 | 
| commit | da5a33d206431f885a4dc029d79f693a27ef293a (patch) | |
| tree | e4804568c053d3e08adcab54320a614f38a3c285 /test/unit | |
| parent | bd683d93cb8d967f761d53f7a6b4243eb8eaedea (diff) | |
Add statvfs support
This support will help other consumers to get the statvfs
details.
Change-Id: Iee4e84a515ff80f24add812ad6fcf84c992bf356
Signed-off-by: hchiramm <hchiramm@redhat.com>
Diffstat (limited to 'test/unit')
| -rw-r--r-- | test/unit/gluster/test_gfapi.py | 15 | 
1 files changed, 15 insertions, 0 deletions
diff --git a/test/unit/gluster/test_gfapi.py b/test/unit/gluster/test_gfapi.py index e0308f7..c7627b1 100644 --- a/test/unit/gluster/test_gfapi.py +++ b/test/unit/gluster/test_gfapi.py @@ -498,6 +498,21 @@ class TestVolume(unittest.TestCase):          with patch("glusterfs.gfapi.api.glfs_stat", mock_glfs_stat):              self.assertRaises(OSError, self.vol.stat, "file.txt") +    def test_statvfs_success(self): +        mock_glfs_statvfs = Mock() +        mock_glfs_statvfs.return_value = 0 + +        with patch("glusterfs.gfapi.api.glfs_statvfs", mock_glfs_statvfs): +            s = self.vol.statvfs("/") +            self.assertTrue(isinstance(s, gfapi.Statvfs)) + +    def test_statvfs_fail_exception(self): +        mock_glfs_statvfs = Mock() +        mock_glfs_statvfs.return_value = -1 + +        with patch("glusterfs.gfapi.api.glfs_statvfs", mock_glfs_statvfs): +            self.assertRaises(OSError, self.vol.statvfs, "/") +      def test_makedirs_success(self):          mock_glfs_mkdir = Mock()          mock_glfs_mkdir.side_effect = [0, 0]  | 
