Beispiel #1
0
 def test_dict_replacer_one_item_phrase(self):
     phrase = '<a>'
     dictionary = {'a': 'successful'}
     result = se.dict_replacer(phrase, dictionary)
     self.assertEqual('successful', result)
Beispiel #2
0
 def test_dict_replacer_two_items_phrase(self):
     phrase = 'I think <1> lives in <2>.'
     dictionary = {'1': 'Nate', '2': 'Idaho'}
     result = se.dict_replacer(phrase, dictionary)
     self.assertEqual('I think Nate lives in Idaho.', result)
Beispiel #3
0
 def test_dict_replacer_no_phrase(self):
     phrase = ''
     dictionary = {}
     result = se.dict_replacer(phrase, dictionary)
     self.assertEqual('', result)