コード例 #1
0
ファイル: test.py プロジェクト: w0ryn/rd-brown-bag
 def test_dict_replacer_one_item_phrase(self):
     phrase = '<a>'
     dictionary = {'a': 'successful'}
     result = se.dict_replacer(phrase, dictionary)
     self.assertEqual('successful', result)
コード例 #2
0
ファイル: test.py プロジェクト: w0ryn/rd-brown-bag
 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)
コード例 #3
0
ファイル: test.py プロジェクト: w0ryn/rd-brown-bag
 def test_dict_replacer_no_phrase(self):
     phrase = ''
     dictionary = {}
     result = se.dict_replacer(phrase, dictionary)
     self.assertEqual('', result)