Ejemplo n.º 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)
Ejemplo n.º 2
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)
Ejemplo n.º 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))
Ejemplo n.º 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))
Ejemplo n.º 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))
Ejemplo n.º 6
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))
Ejemplo n.º 7
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))
Ejemplo n.º 8
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))