def METHOD_NAME(self):
    out = sh("pmset -g batt")
    percent = re.search(r"(\d+)%", out).group(1)
    drawing_from = re.search("Now drawing from '([^']+)'", out).group(1)
    power_plugged = drawing_from == "AC Power"
    psutil_result = psutil.sensors_battery()
    self.assertEqual(psutil_result.power_plugged, power_plugged)
    self.assertEqual(psutil_result.percent, int(percent))