Skip to content

Commit

Permalink
fsinfo: change an if: to an assert
Browse files Browse the repository at this point in the history
fsinfo was already at 100% lines coverage, but this allows it to reach
100% branch coverage as well.
  • Loading branch information
allisonkarlitskaya committed Jan 26, 2024
1 parent a00feeb commit 4021b8a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/cockpit/channels/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,8 +493,9 @@ def do_identity_changed(self, fd: 'Handle | None', err: 'int | None') -> None:
self.report_error(err)

def do_close(self) -> None:
if self.path_watch is not None:
self.path_watch.close()
# non-watch channels close immediately — if we get this, we're watching
assert self.path_watch is not None
self.path_watch.close()
self.close()

def do_open(self, options: JsonObject) -> None:
Expand Down

0 comments on commit 4021b8a

Please sign in to comment.