def test_note_correctly_updated(self): operations.create_new_note("title", "body") operations.update_note(1, "new title", "new body") notes = operations.get_list_of_notes() self.assertEqual(1, notes.count()) self.assertEqual("new title", notes[0].title) self.assertEqual("new body", notes[0].body)
def test_method_runs(self): operations.create_new_note("title", "body") operations.print_list_of_notes()
def test_body_must_be_string(self): try: operations.create_new_note("", 34.2) self.fail("TypeError should have been thrown") except TypeError: pass
def test_valid_note_is_created(self): operations.create_new_note("title", "body") notes = operations.get_list_of_notes() self.assertEqual(1, notes.count()) self.assertEqual("title", notes[0].title) self.assertEqual("body", notes[0].body)
__author__ = "Luke Merrett" import settings import arguments import operations operations.setup_database(settings.sqlite_database_name) args = arguments.GetArguments() if args.list_notes: operations.print_list_of_notes() if args.create_note: operations.create_new_note(args.create_note[0], args.create_note[1]) if args.update_note: operations.update_note(args.update_note[0], args.update_note[1], args.update_note[2])