コード例 #1
0
 def test_notate_to_changed(self):
     saved_ham = options["Headers", "header_ham_string"]
     notate_to = options.get_option("Headers", "notate_to")
     saved_to = notate_to.allowed_values
     try:
         options["Headers", "header_ham_string"] = "bacon"
         header_strings = (options["Headers", "header_ham_string"],
                           options["Headers", "header_spam_string"],
                           options["Headers", "header_unsure_string"])
         notate_to = options.get_option("Headers", "notate_to")
         notate_to.allowed_values = header_strings
         self.ham = options["Headers", "header_ham_string"]
         result = self.test_notate_to_ham()
         self.assertEqual(self.msg["To"].split(',', 1)[0],
                          "*****@*****.**")
     finally:
         options["Headers", "header_ham_string"] = saved_ham
         self.ham = saved_ham
         notate_to.allowed_values = saved_to
     return result
コード例 #2
0
ファイル: test_message.py プロジェクト: Xodarap/Eipi
 def test_notate_to_changed(self):
     saved_ham = options["Headers", "header_ham_string"]
     notate_to = options.get_option("Headers", "notate_to")
     saved_to = notate_to.allowed_values
     try:
         options["Headers", "header_ham_string"] = "bacon"
         header_strings = (options["Headers", "header_ham_string"],
                           options["Headers", "header_spam_string"],
                           options["Headers", "header_unsure_string"])
         notate_to = options.get_option("Headers", "notate_to")
         notate_to.allowed_values = header_strings
         self.ham = options["Headers", "header_ham_string"]
         result = self.test_notate_to_ham()
         # Just be sure that it's using the new value.
         self.assertEqual(self.msg["To"].split(',', 1)[0],
                          "bacon")
     finally:
         # If we leave these changed, then lots of other tests will
         # fail.
         options["Headers", "header_ham_string"] = saved_ham
         self.ham = saved_ham
         notate_to.allowed_values = saved_to
     return result
コード例 #3
0
 def test_notate_to_changed(self):
     saved_ham = options["Headers", "header_ham_string"]
     notate_to = options.get_option("Headers", "notate_to")
     saved_to = notate_to.allowed_values
     try:
         options["Headers", "header_ham_string"] = "bacon"
         header_strings = (options["Headers", "header_ham_string"],
                           options["Headers", "header_spam_string"],
                           options["Headers", "header_unsure_string"])
         notate_to = options.get_option("Headers", "notate_to")
         notate_to.allowed_values = header_strings
         self.ham = options["Headers", "header_ham_string"]
         result = self.test_notate_to_ham()
         # Just be sure that it's using the new value.
         self.assertEqual(self.msg["To"].split(',', 1)[0],
                          "*****@*****.**")
     finally:
         # If we leave these changed, then lots of other tests will
         # fail.
         options["Headers", "header_ham_string"] = saved_ham
         self.ham = saved_ham
         notate_to.allowed_values = saved_to
     return result