def auth_username(self, username): self.__auth_username = Parser.coerce_string_to_ascii(username)
def auth_password(self, password): self.__auth_password = Parser.coerce_string_to_ascii(password)
def test_coerce_string_to_ascii(self): result = Parser.coerce_string_to_ascii(bytes("Hello", 'utf-8')) self.assertEqual(result, "Hello".encode('ascii'))