Skip to content

Commit

Permalink
Merge branch 'master' of github.com:giampaolo/psutil
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Oct 29, 2017
2 parents b30bef8 + fe53d1a commit 04087b9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion psutil/tests/test_linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -1326,7 +1326,9 @@ def test_emulate_energy_full_not_avail(self):
# Emulate a case where energy_full file does not exist.
# Expected fallback on /capacity.
def open_mock(name, *args, **kwargs):
if name.startswith("/sys/class/power_supply/BAT0/energy_full"):
energy_full = "/sys/class/power_supply/BAT0/energy_full"
charge_full = "/sys/class/power_supply/BAT0/charge_full"
if name.startswith(energy_full) or name.startswith(charge_full):
raise IOError(errno.ENOENT, "")
elif name.startswith("/sys/class/power_supply/BAT0/capacity"):
return io.BytesIO(b"88")
Expand Down

0 comments on commit 04087b9

Please sign in to comment.