Skip to content

Commit

Permalink
test: assert we don't send extra attributes over in fsinfo
Browse files Browse the repository at this point in the history
Verify we only send what is specified, this uncovered interesting fsinfo
behaviour depending if you send `fnmatch='*.txt'` or `fnmatch=''` the
latter does not set `entries` while `*.txt` does likely as `''` does not
match anything and thus no `entries` are set.
  • Loading branch information
jelly committed Feb 13, 2025
1 parent 7c5ae7e commit 4ad7e12
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/pytest/test_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -1298,14 +1298,16 @@ async def test_fsinfo_watch_identity_changes(

@pytest.mark.asyncio
async def test_fsinfo_self_owner(transport: MockTransport, tmp_path: Path) -> None:
client = await FsInfoClient.open(transport, tmp_path, ['user', 'uid', 'group', 'gid'])
client = await FsInfoClient.open(transport, tmp_path, ['user', 'uid', 'group', 'gid'], fnmatch='')
state = await client.wait()
info = get_dict(state, 'info')

assert get_int(info, 'uid') == os.getuid()
assert get_int(info, 'gid') == os.getgid()
assert info.get('user') == getpass.getuser()
assert info.get('group') == grp.getgrgid(os.getgid()).gr_name # hopefully true...
# user, uid, group, gid
assert len(info.keys()) == 4


@pytest.mark.asyncio
Expand Down

0 comments on commit 4ad7e12

Please sign in to comment.