Ejemplo n.º 1
0
 def test_get_note_from_begining(self):
     erika = NotesApplication("Erika")
     erika.create("Black Justice")
     self.assertEqual(
         "Black Justice",
         erika.get(0),
         msg="get() method does not return the right value at 0 index")
 def test_get_note_from_mid(self):
     erika = NotesApplication("Erika")
     erika.create(1)
     erika.create(2)
     erika.create("Ultron")
     erika.create("Ultimatio")
     erika.create(3)
     erika.create("Thoughts are random")
     self.assertEqual("Ultimatio", erika.get(3), msg="get() method does not return the right value within the list")
 def test_get_note_from_end(self):
     erika = NotesApplication("Erika")
     erika.create("Tripping")
     erika.create(1)
     erika.create(2)
     erika.create("Ultron")
     erika.create("Ultimatio")
     erika.create(3)
     erika.create("Thoughts are random")
     self.assertEqual("Thoughts are random", erika.get(6), msg="get() method does not return the right value at the last index")
Ejemplo n.º 4
0
 def test_get_note_from_mid(self):
     erika = NotesApplication("Erika")
     erika.create(1)
     erika.create(2)
     erika.create("Ultron")
     erika.create("Ultimatio")
     erika.create(3)
     erika.create("Thoughts are random")
     self.assertEqual(
         "Ultimatio",
         erika.get(3),
         msg="get() method does not return the right value within the list")
Ejemplo n.º 5
0
 def test_get_note_from_end(self):
     erika = NotesApplication("Erika")
     erika.create("Tripping")
     erika.create(1)
     erika.create(2)
     erika.create("Ultron")
     erika.create("Ultimatio")
     erika.create(3)
     erika.create("Thoughts are random")
     self.assertEqual(
         "Thoughts are random",
         erika.get(6),
         msg="get() method does not return the right value at the last index"
     )
            "Enter 2 to list all notes.\n"
            "Enter 3 to get a specific note.\n"
            "Enter 4 to search notes for a string.\n"
            "Enter 5 to delete a specific note.\n"
            "Enter 6 to edit a specific note.\n"
            "Enter 0 to exit Application.\n\n>>> "
        )
    )
    if userInput == 1:
        methodArgument = input("Enter new content:")
        noteObject.create(methodArgument)
    elif userInput == 2:
        noteObject.list()
    elif userInput == 3:
        methodArgument = input("Enter index for the specific note you want " "from the list: ")
        noteObject.get(int(methodArgument))
    elif userInput == 4:
        methodArgument = input("Enter your search string: ")
        noteObject.search(methodArgument)
    elif userInput == 5:
        methodArgument = input("What is the index of the note you want to " "remove: ")
        noteObject.delete(int(methodArgument))
    elif userInput == 6:
        methodArgumentOne = input("What is the index of the note you want to" "remove: ")
        methodArgumentTwo = input("What do you want to replace it with: ")
        noteObject.edit(int(methodArgumentOne), methodArgumentTwo)
    elif userInput == 0:
        print("You have successfully exited the Application")
    else:
        print("You entered an invalid input.")
Ejemplo n.º 7
0
		               		"Enter 3 to get a specific note.\n"
		               		"Enter 4 to search notes for a string.\n"
		               		"Enter 5 to delete a specific note.\n"
		               		"Enter 6 to edit a specific note.\n"
		               		"Enter 0 to exit Application.\n\n>>> "
	                ))
	if userInput == 1:
		methodArgument = input("Enter new content:")
		noteObject.create(methodArgument)
	elif userInput == 2:
		noteObject.list()
	elif userInput == 3:
		methodArgument = input("Enter index for the specific note you want "
								"from the list: "
							)
		noteObject.get(int(methodArgument))
	elif userInput == 4:
		methodArgument = input("Enter your search string: ")
		noteObject.search(methodArgument)
	elif userInput == 5:
		methodArgument = input("What is the index of the note you want to "
								"remove: "
							)
		noteObject.delete(int(methodArgument))
	elif userInput == 6:
		methodArgumentOne = input("What is the index of the note you want to"
									"remove: "
								)
		methodArgumentTwo = input("What do you want to replace it with: ")
		noteObject.edit(int(methodArgumentOne), methodArgumentTwo)
	elif userInput == 0:
 def test_get_note_from_begining(self):
     erika = NotesApplication("Erika")
     erika.create("Black Justice")
     self.assertEqual("Black Justice", erika.get(0), msg="get() method does not return the right value at 0 index")