8000 make the unit tests pass back on python 2.7 · Stackdriver/twilio-python@3c481a1 · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Feb 1, 2018. It is now read-only.

Commit 3c481a1

Browse files
committed
make the unit tests pass back on python 2.7
1 parent 98a0e91 commit 3c481a1

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

tests/test_twiml.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# -*- coding: utf-8 -*-
22
from __future__ import with_statement
3+
from __future__ import unicode_literals
34
import re
45
from six import u, text_type
56
import twilio
@@ -63,7 +64,7 @@ def testSayHelloWorld(self):
6364
def testSayFrench(self):
6465
"""should say hello monkey"""
6566
r = Response()
66-
r.append(twiml.Say(u("nécessaire et d'autres")))
67+
r.append(twiml.Say("nécessaire et d'autres")) # it works on python 2.6 with the from __future__ import unicode_literal
6768
self.assertEquals(text_type(r),
6869
'<?xml version="1.0" encoding="UTF-8"?><Response><Say>n&#233;cessaire et d\'autres</Say></Response>')
6970

tests/test_unicode.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# -*- coding: utf-8 -*-
2+
from __future__ import unicode_literals
23
from mock import patch, Mock
34
from six import u
45
from twilio.rest import resources
@@ -42,7 +43,7 @@ def test_double_encoding(resp_mock, mock):
4243
http = mock.return_value
4344
http.request.return_value = (Mock(), Mock())
4445

45-
body = u("Chloéñ")
46+
body = "Chloéñ" # I can do that with the from future import
4647

4748
data = {
4849
"body": body.encode('utf-8'),
@@ -61,7 +62,7 @@ def test_paging(resp_mock, mock):
6162
http.request.return_value = (Mock(), Mock())
6263

6364
data = {
64-
"body": u("Chloéñ"),
65+
"body": "Chloéñ", # I can do that with the from future import
6566
}
6667

6768
resources.make_request("GET", "http://www.example.com", data=data)

0 commit comments

Comments
 (0)
0