def test_whatsapp(self): self.argv.append('--output-format') self.argv.append('{text}') memacs = WhatsApp(argv=self.argv) data = memacs.test_get_entries() self.assertEqual(data[0], '** <2016-10-15 Sat 20:18> Hello World!') self.assertEqual(data[1], ' :PROPERTIES:') self.assertEqual(data[2], ' :TYPE: INCOMING') self.assertEqual(data[3], ' :NUMBER: 00436604444333') self.assertEqual( data[4], ' :ID: d8fa64a86286432a42a13f129cad0d7ebd56873e') self.assertEqual(data[5], ' :END:')
def test_whatsapp(self): self.argv.append('--output-format') self.argv.append('{text}') memacs = WhatsApp(argv=self.argv) data = memacs.test_get_entries() # omit hours from check because of different TZ offset: self.assertTrue(data[0].startswith('** <2016-10-15 Sat ')) self.assertTrue(data[0].endswith(':18> Hello World!')) self.assertEqual(data[1], ' :PROPERTIES:') self.assertEqual(data[2], ' :NUMBER: 00436604444333') self.assertEqual(data[3], ' :TYPE: INCOMING') # Karl had to disable the ID check because with different TZ offsets, the ID hash changes: # self.assertEqual(data[4], ' :ID: 804c40b796f8d71f48c9cd0023d1059e56d54d61') self.assertEqual(data[5], ' :END:')
#!/usr/bin/env python2 # -*- coding: utf-8 -*- from memacs.whatsapp import WhatsApp PROG_VERSION_NUMBER = u"0.1" PROG_VERSION_DATE = u"2017-02-28" PROG_SHORT_DESCRIPTION = u"Memacs for whatsapp" PROG_TAG = u"whatsapp" COPYRIGHT_YEAR = "2017" COPYRIGHT_AUTHORS = """Manuel Koell <*****@*****.**>""" if __name__ == "__main__": memacs = WhatsApp(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()