Esempio n. 1
0
    def test_lgetxattr(self):
        '''lgetxattr() gets the value of an attribute set on the file.'''

        if self.user_xattr_are_supported():
            _obnam.lsetxattr(self.filename, "user.hello", "world")
            self.assertEqual(_obnam.lgetxattr(self.filename, "user.hello"),
                             "world")
Esempio n. 2
0
    def test_lgetxattr(self):
        '''lgetxattr() gets the value of an attribute set on the file.'''

        if self.user_xattr_are_supported():
            _obnam.lsetxattr(self.filename, "user.hello", "world")
            self.assertEqual(
                _obnam.lgetxattr(self.filename, "user.hello"),
                "world")
Esempio n. 3
0
    def test_lsetxattr(self):
        """lsetxattr() sets an attribute on a file."""

        if self.user_xattr_are_supported():
            _obnam.lsetxattr(self.filename, "user.key", "value")
            _obnam.lsetxattr(self.filename, "user.hello", "world")
            ret = _obnam.llistxattr(self.filename)

            self.assertEqual(sorted(ret.strip("\0").split("\0")), ["user.hello", "user.key"])
Esempio n. 4
0
    def test_lsetxattr(self):
        '''lsetxattr() sets an attribute on a file.'''

        if self.user_xattr_are_supported():
            _obnam.lsetxattr(self.filename, "user.key", "value")
            _obnam.lsetxattr(self.filename, "user.hello", "world")
            ret = _obnam.llistxattr(self.filename)

            self.assertEqual(sorted(ret.strip("\0").split("\0")),
                             ["user.hello", "user.key"])
Esempio n. 5
0
 def test_lgetxattr(self):
     '''lgetxattr() gets the value of an attribute set on the file.'''
     _obnam.lsetxattr(self.filename, "user.hello", "world")
     self.assertEqual(_obnam.lgetxattr(self.filename, "user.hello"), "world")
Esempio n. 6
0
 def test_lsetxattr(self):
     '''lsetxattr() sets an attribute on a file.'''
     _obnam.lsetxattr(self.filename, "user.key", "value")
     _obnam.lsetxattr(self.filename, "user.hello", "world")
     self.assertEqual(sorted(_obnam.llistxattr(self.filename).strip("\0").split("\0")),
                      ["user.hello", "user.key"])