2020-12-01 13:58:09 +01:00
|
|
|
Index: psutil-5.7.3/psutil/tests/test_linux.py
|
|
|
|
===================================================================
|
|
|
|
--- psutil-5.7.3.orig/psutil/tests/test_linux.py
|
|
|
|
+++ psutil-5.7.3/psutil/tests/test_linux.py
|
|
|
|
@@ -1564,6 +1564,8 @@ class TestSensorsBattery(PsutilTestCase)
|
2020-08-21 17:27:58 +02:00
|
|
|
self.assertIsNone(psutil.sensors_battery().power_plugged)
|
|
|
|
assert m.called
|
|
|
|
|
2020-08-21 17:34:45 +02:00
|
|
|
+ @unittest.skipUnless(os.path.exists('/sys/class/power_supply/BAT0/energy_full'),
|
|
|
|
+ 'Missing /sys/class/power_supply/BAT0/energy_full file.')
|
2020-08-21 17:27:58 +02:00
|
|
|
def test_emulate_energy_full_0(self):
|
|
|
|
# Emulate a case where energy_full files returns 0.
|
|
|
|
with mock_open_content(
|
2020-12-01 13:58:09 +01:00
|
|
|
@@ -1571,6 +1573,8 @@ class TestSensorsBattery(PsutilTestCase)
|
2020-08-21 17:27:58 +02:00
|
|
|
self.assertEqual(psutil.sensors_battery().percent, 0)
|
|
|
|
assert m.called
|
|
|
|
|
2020-08-21 17:34:45 +02:00
|
|
|
+ @unittest.skipUnless(os.path.exists('/sys/class/power_supply/BAT0/energy_full'),
|
|
|
|
+ 'Missing /sys/class/power_supply/BAT0/energy_full file.')
|
2020-08-21 17:27:58 +02:00
|
|
|
def test_emulate_energy_full_not_avail(self):
|
|
|
|
# Emulate a case where energy_full file does not exist.
|
|
|
|
# Expected fallback on /capacity.
|