def test_reverse_lookup(self):
        pb = "phonebook.pb"
        number = '234 521 2332'

        self.test_add()
        self.test_change()

        self.assertEqual(phonebook.reverse_lookup(number, pb), "John Michael 234 521 2332")
 def test_reverse_lookup_mult(self):
     phonebook.reverse_lookup(pb_path, "212 234 2693")
     self.verify('James John 212 234 2693\nJohn Carter 212 234 2693\nSmith John 212 234 2693\nWow Doge 212 234 2693')
 def test_reverse_lookup(self):
     phonebook.reverse_lookup(pb_path, "917 555 5555")
     self.verify('Sssss Fffff 917 555 5555')
Exemple #4
0
 def test_failed_reverse_lookup(self):
     self.assertEqual(
         phonebook.reverse_lookup("123 344 2332", "testing.db"),
         'Phone number 123 344 2332 does not exist in the db')
Exemple #5
0
 def test_successful_reverse_lookup(self):
     self.assertEqual(
         phonebook.reverse_lookup("123 345 2332", "testing.db"),
         "Joe Jean 123 345 2332")
	def test_reverse_lookup(self):
		print "test_reverse-lookup called"
		result = phonebook.reverse_lookup(phonebook.read_pb(filename), '555')
		self.assertEqual(result, 'Alan 555')