def test_battery(self): path = os.path.dirname(os.path.abspath(__file__)) argv = [] argv.append("-p") argv.append(os.path.join(path, "data")) memacs = Battery(argv=argv) data = memacs.test_get_entries() self.assertEqual(data[1], " :PROPERTIES:") self.assertEqual(data[2], " :CYCLE_COUNT: 866") self.assertEqual(data[3], " :CAPACITY: 97%") self.assertEqual(data[4], " :STATUS: discharging") self.assertEqual(data[5], " :CONSUMPTION: 11.9 W") self.assertEqual(data[7], " :END:")
#!/usr/bin/python2 # -*- coding: utf-8 -*- from memacs.battery import Battery PROG_VERSION_NUMBER = "0.1" PROG_VERSION_DATE = "2017-02-24" PROG_SHORT_DESCRIPTION = "Memacs for battery" PROG_TAG = "battery" COPYRIGHT_YEAR = "2017" COPYRIGHT_AUTHORS = """Manuel Koell <*****@*****.**>""" if __name__ == "__main__": memacs = Battery(prog_version=PROG_VERSION_NUMBER, prog_version_date=PROG_VERSION_DATE, prog_short_description=PROG_SHORT_DESCRIPTION, prog_tag=PROG_TAG, copyright_year=COPYRIGHT_YEAR, copyright_authors=COPYRIGHT_AUTHORS) memacs.handle_main()
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from memacs.battery import Battery PROG_VERSION_NUMBER = "0.1" PROG_VERSION_DATE = "2017-02-24" PROG_SHORT_DESCRIPTION = "Memacs for battery" PROG_TAG = "battery" COPYRIGHT_YEAR = "2017" COPYRIGHT_AUTHORS = """Manuel Koell <*****@*****.**>""" if __name__ == "__main__": memacs = Battery( prog_version=PROG_VERSION_NUMBER, prog_version_date=PROG_VERSION_DATE, prog_short_description=PROG_SHORT_DESCRIPTION, prog_tag=PROG_TAG, copyright_year=COPYRIGHT_YEAR, copyright_authors=COPYRIGHT_AUTHORS ) memacs.handle_main()