def test_forgetlast(self): text = "This one is a test. This poem is a haiku. Refrigerator." expected = "*This one is a test.*\n*This poem is a haiku.*\n*Refrigerator.*" self.assertIsNotNone(haiku.parseHaiku(text, False)) self.assertEqual(haiku.save(""), haiku._savedHaiku) self.assertEqual(haiku.recall(), expected) self.assertEqual(haiku.forget(""), haiku._forgetSuccess)
def test_savewithkeywords(self): text1 = "This one is a test. This poem is a haiku. Refrigerator." text2 = "This too is a test. This poem is a haiku. Refrigerator." expected = "*This one is a test.*\n*This poem is a haiku.*\n*Refrigerator.*" self.assertIsNotNone(haiku.parseHaiku(text1, False)) self.assertIsNotNone(haiku.parseHaiku(text2, False)) self.assertEqual(haiku.save("This one"), haiku._savedHaiku) self.assertEqual(haiku.recall(), expected)
def test_recallemptymemory(self): self.assertEqual(haiku.recall(), haiku._emptyMemory)