def test_whole_sentence(self): sentence = "This & that & that & this." encoded = "This & that & that & this." self.assertEqual(encode_ampersands(sentence), encoded)
def test_copyright(self): self.assertEqual(encode_ampersands("©"), "©")
def test_numeric_encoding(self): self.assertEqual(encode_ampersands("&"), "&")
def test_a_and_w(self): self.assertEqual(encode_ampersands("A&W"), "A&W")
def test_encoded_ampersand(self): self.assertEqual(encode_ampersands("&"), "&")