예제 #1
0
    def test_set_empty(self):
        # This test also has the side-effect of testing that we're handling
        # empty vector results correctly.

        statgrab.set_valid_filesystems([])
        self.assertEqual(statgrab.get_valid_filesystems(), [])

        # If we set the list of valid filesystems to be empty, we shouldn't get
        # any filesystem results.
        self.assertEqual(len(statgrab.get_fs_stats()), 0)
예제 #2
0
파일: test.py 프로젝트: i-scream/pystatgrab
    def test_set_empty(self):
        # This test also has the side-effect of testing that we're handling
        # empty vector results correctly.

        statgrab.set_valid_filesystems([])
        self.assertEqual(statgrab.get_valid_filesystems(), [])

        # If we set the list of valid filesystems to be empty, we shouldn't get
        # any filesystem results.
        self.assertEqual(len(statgrab.get_fs_stats()), 0)
예제 #3
0
 def test_set_new(self):
     vfs1 = ["ext4", "notarealfs", "isofs"]
     statgrab.set_valid_filesystems(vfs1)
     vfs2 = statgrab.get_valid_filesystems()
     # The order can differ but the contents should be the same.
     self.assertEqual(sorted(vfs1), sorted(vfs2))
예제 #4
0
 def test_set_existing(self):
     vfs1 = statgrab.get_valid_filesystems()
     statgrab.set_valid_filesystems(vfs1)
     vfs2 = statgrab.get_valid_filesystems()
     # The order can differ but the contents should be the same.
     self.assertEqual(sorted(vfs1), sorted(vfs2))
예제 #5
0
 def test_get(self):
     vfs = statgrab.get_valid_filesystems()
     self.assertTrue(isinstance(vfs, list))
     self.assertTrue(len(vfs) > 0)
     for s in vfs:
         self.assertTrue(isinstance(s, str))
예제 #6
0
파일: test.py 프로젝트: i-scream/pystatgrab
 def test_set_new(self):
     vfs1 = ["ext4", "notarealfs", "isofs"]
     statgrab.set_valid_filesystems(vfs1)
     vfs2 = statgrab.get_valid_filesystems()
     # The order can differ but the contents should be the same.
     self.assertEqual(sorted(vfs1), sorted(vfs2))
예제 #7
0
파일: test.py 프로젝트: i-scream/pystatgrab
 def test_set_existing(self):
     vfs1 = statgrab.get_valid_filesystems()
     statgrab.set_valid_filesystems(vfs1)
     vfs2 = statgrab.get_valid_filesystems()
     # The order can differ but the contents should be the same.
     self.assertEqual(sorted(vfs1), sorted(vfs2))
예제 #8
0
파일: test.py 프로젝트: i-scream/pystatgrab
 def test_get(self):
     vfs = statgrab.get_valid_filesystems()
     self.assertTrue(isinstance(vfs, list))
     self.assertTrue(len(vfs) > 0)
     for s in vfs:
         self.assertTrue(isinstance(s, str))