Skip to content

Commit

Permalink
test xattr (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
xyb authored Sep 10, 2021
1 parent fa10284 commit 315ee48
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/test_juicefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,21 @@ def test_read_content_with_zero(jfs, filename):
f.read() == CONTENT_WITH_ZERO


def test_xattr(jfs, filename):
jfs.create(filename)

attr = "com.megfile.color"
assert jfs.listxattr(filename) == []
with pytest.raises(OSError):
jfs.getxattr(filename, attr)
jfs.setxattr(filename, attr, b"green")
assert jfs.listxattr(filename) == [attr]
assert jfs.getxattr(filename, attr) == b"green"
jfs.removexattr(filename, attr)
with pytest.raises(OSError):
jfs.getxattr(filename, attr)


# TODO: read-write mode not supported in this version
# def test_read_write_wbp(jfs, filename):
# TEXT = b"hello world"
Expand Down

0 comments on commit 315ee48

Please sign in to comment.