Skip to content

Commit 7f0e25b

Browse files
committed
* Removes Python2 imports from the tests.
1 parent fc0a669 commit 7f0e25b

19 files changed

+36
-139
lines changed

tests/test_balance.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
import unittest
2-
from messagebird import Client
2+
from unittest.mock import Mock
33

4-
try:
5-
from unittest.mock import Mock
6-
except ImportError:
7-
# mock was added to unittest in Python 3.3, but was an external library
8-
# before.
9-
from mock import Mock
4+
from messagebird import Client
105

116

127
class TestBalance(unittest.TestCase):

tests/test_call.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
import json
22
import unittest
3-
from messagebird import Client, ErrorException
3+
from unittest.mock import Mock
4+
5+
from messagebird import Client
46
from messagebird.base import Base
5-
from messagebird.client import VOICE_TYPE
6-
7-
try:
8-
from unittest.mock import Mock
9-
except ImportError:
10-
# mock was added to unittest in Python 3.3, but was an external library
11-
# before.
12-
from mock import Mock
137

148

159
class TestCall(unittest.TestCase):

tests/test_call_flow.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
import unittest
2-
from messagebird import Client
2+
from unittest.mock import Mock
33

4-
try:
5-
from unittest.mock import Mock
6-
except ImportError:
7-
# mock was added to unittest in Python 3.3, but was an external library
8-
# before.
9-
from mock import Mock
4+
from messagebird import Client
105

116

127
class TestCallFlow(unittest.TestCase):

tests/test_contact.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
import unittest
2-
from messagebird import Client, ErrorException
2+
from unittest.mock import Mock
33

4-
try:
5-
from unittest.mock import Mock
6-
except ImportError:
7-
# mock was added to unittest in Python 3.3, but was an external library
8-
# before.
9-
from mock import Mock
4+
from messagebird import Client, ErrorException
105

116

127
class TestContact(unittest.TestCase):

tests/test_conversation.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
import unittest
22
from datetime import datetime
3+
from unittest.mock import Mock
34

45
from dateutil.tz import tzutc
56

67
from messagebird import Client
78

8-
try:
9-
from unittest.mock import Mock
10-
except ImportError:
11-
# mock was added to unittest in Python 3.3, but was an external library
12-
# before.
13-
from mock import Mock
14-
159

1610
class TestConversation(unittest.TestCase):
1711

tests/test_conversation_message.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
import unittest
22
from datetime import datetime
3+
from unittest.mock import Mock
34

45
from dateutil.tz import tzutc
56

67
from messagebird import Client
78

8-
try:
9-
from unittest.mock import Mock
10-
except ImportError:
11-
# mock was added to unittest in Python 3.3, but was an external library
12-
# before.
13-
from mock import Mock
14-
159

1610
class TestConversationMessage(unittest.TestCase):
1711

tests/test_conversation_webhook.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import unittest
21
import json
2+
import unittest
33
from datetime import datetime
4+
from unittest.mock import Mock
45

56
from dateutil.tz import tzutc
67

@@ -9,13 +10,6 @@
910
CONVERSATION_WEBHOOK_EVENT_CONVERSATION_CREATED, \
1011
CONVERSATION_WEBHOOK_EVENT_CONVERSATION_UPDATED
1112

12-
try:
13-
from unittest.mock import Mock
14-
except ImportError:
15-
# mock was added to unittest in Python 3.3, but was an external library
16-
# before.
17-
from mock import Mock
18-
1913

2014
class TestConversationWebhook(unittest.TestCase):
2115

tests/test_group.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
import unittest
2-
from messagebird import Client
2+
from unittest.mock import Mock
33

4-
try:
5-
from unittest.mock import Mock
6-
except ImportError:
7-
# mock was added to unittest in Python 3.3, but was an external library
8-
# before.
9-
from mock import Mock
4+
from messagebird import Client
105

116

127
class TestGroup(unittest.TestCase):

tests/test_hlr.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
import unittest
2-
from messagebird import Client
2+
from unittest.mock import Mock
33

4-
try:
5-
from unittest.mock import Mock
6-
except ImportError:
7-
# mock was added to unittest in Python 3.3, but was an external library
8-
# before.
9-
from mock import Mock
4+
from messagebird import Client
105

116

127
class TestHLR(unittest.TestCase):

tests/test_lookup.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
import unittest
2-
from messagebird import Client
2+
from unittest.mock import Mock
33

4-
try:
5-
from unittest.mock import Mock
6-
except ImportError:
7-
# mock was added to unittest in Python 3.3, but was an external library
8-
# before.
9-
from mock import Mock
4+
from messagebird import Client
105

116

127
class TestLookup(unittest.TestCase):

0 commit comments

Comments
 (0)