def test_edit_changes_with_tuple(self): """test if edit changes the right variable to the right value """ note_app = NotesApplication("Ben") note_app.create("Note 0") note_app.edit(0, (1, 2)) self.assertEqual(note_app.notes[0], (1, 2), msg="edit value incorrect")
def test_edit_note(self): test = NotesApplication("test") test.create("emeka is a boy") test.create("ada is a girl") test.create("Real studio") appOutput = ("Note ID: 0\nemeka is boy\nBy Author Erika\n" "Note ID: 1\nchidi is fresh\nBy Author Erika\n" "Note ID: 2\nReal studio\nBy Author Erika\n" ) test.edit(1, "chidi is fresh") with capture(test.list) as output: self.assertEqual(appOutput, output, msg="edit() method does not edit note specified by index")
def test_edit_with_bad_index(self): """test if edit recongnizes bad indexes """ note_app = NotesApplication("Ben") note_app.create("Note 0") self.assertFalse(note_app.edit(10, "New Note 0"), msg="edit was unsuccessful")
def test_edit_with_valid_parameters(self): """test for normal edit behaviour """ note_app = NotesApplication("Ben") note_app.create("Note 0") self.assertTrue(note_app.edit(0, "New Note 0"), msg="edit was unsuccessful")