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