Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
 def test_method_runs(self):
   operations.create_new_note("title", "body")
   operations.print_list_of_notes()
Exemplo n.º 3
0
 def test_body_must_be_string(self):
   try:
     operations.create_new_note("", 34.2)
     self.fail("TypeError should have been thrown")
   except TypeError:
     pass
Exemplo n.º 4
0
 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)
Exemplo n.º 5
0
__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])