示例#1
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"])
示例#2
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"])
示例#3
0
    def test_empty_list(self):
        """A new file has no extended attributes."""

        if self.user_xattr_are_supported():
            self.assertEqual(_obnam.llistxattr(self.filename), "")
示例#4
0
    def test_empty_list(self):
        '''A new file has no extended attributes.'''

        if self.user_xattr_are_supported():
            self.assertEqual(_obnam.llistxattr(self.filename), "")
示例#5
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"])
示例#6
0
 def test_empty_list(self):
     '''A new file has no extended attributes.'''
     self.assertEqual(_obnam.llistxattr(self.filename), "")