Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: let fake_getpwuid return pwd.struct_passwd #248

Merged
merged 1 commit into from
Nov 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/integration/test_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -1565,10 +1565,10 @@
orig_getpwuid = pwd.getpwuid
orig_getuid = os.getuid

def fake_getpwuid(_unused_uid):
def fake_getpwuid(_unused_uid: int) -> pwd.struct_passwd:

Check warning on line 1568 in tests/integration/test_ui.py

View check run for this annotation

Codecov / codecov/patch

tests/integration/test_ui.py#L1568

Added line #L1568 was not covered by tests
r = list(orig_getpwuid(orig_getuid()))
r[4] = "Joe (Hacker,+1 234,,"
return r
return pwd.struct_passwd(r)

Check warning on line 1571 in tests/integration/test_ui.py

View check run for this annotation

Codecov / codecov/patch

tests/integration/test_ui.py#L1571

Added line #L1571 was not covered by tests

pwd.getpwuid = fake_getpwuid
os.getuid = lambda: 1234
Expand Down