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:')