3333sys .path .append ('.' )
3434
3535import telegram
36- from tests .base import BaseTest
37- from nose .tools import timed
36+ from tests .base import BaseTest , timeout
3837
3938
4039class BotTest (BaseTest , unittest .TestCase ):
4140 """This object represents Tests for Telegram Bot."""
4241
4342 @flaky
44- @timed (10 )
43+ @timeout (10 )
4544 def testGetMe (self ):
4645 '''Test the telegram.Bot getMe method'''
4746 print ('Testing getMe' )
@@ -55,7 +54,7 @@ def testGetMe(self):
5554 self .assertEqual (bot .name , '@PythonTelegramBot' )
5655
5756 @flaky
58- @timed (10 )
57+ @timeout (10 )
5958 def testSendMessage (self ):
6059 '''Test the telegram.Bot sendMessage method'''
6160 print ('Testing sendMessage' )
@@ -67,7 +66,7 @@ def testSendMessage(self):
6766 self .assertTrue (isinstance (message .date , datetime ))
6867
6968 @flaky
70- @timed (10 )
69+ @timeout (10 )
7170 def testGetUpdates (self ):
7271 '''Test the telegram.Bot getUpdates method'''
7372 print ('Testing getUpdates' )
@@ -78,7 +77,7 @@ def testGetUpdates(self):
7877 self .assertTrue (isinstance (updates [0 ], telegram .Update ))
7978
8079 @flaky
81- @timed (10 )
80+ @timeout (10 )
8281 def testForwardMessage (self ):
8382 '''Test the telegram.Bot forwardMessage method'''
8483 print ('Testing forwardMessage' )
@@ -92,7 +91,7 @@ def testForwardMessage(self):
9291 self .assertTrue (isinstance (message .forward_date , datetime ))
9392
9493 @flaky
95- @timed (10 )
94+ @timeout (10 )
9695 def testSendPhoto (self ):
9796 '''Test the telegram.Bot sendPhoto method'''
9897 print ('Testing sendPhoto - File' )
@@ -105,7 +104,7 @@ def testSendPhoto(self):
105104 self .assertEqual (message .caption , 'testSendPhoto' )
106105
107106 @flaky
108- @timed (10 )
107+ @timeout (10 )
109108 def testResendPhoto (self ):
110109 '''Test the telegram.Bot sendPhoto method'''
111110 print ('Testing sendPhoto - Resend' )
@@ -116,7 +115,7 @@ def testResendPhoto(self):
116115 self .assertEqual (message .photo [0 ].file_id , 'AgADAQADyKcxGx8j9Qdp6d-gpUsw4Gja1i8ABEVJsVqQk8LfJ3wAAgI' )
117116
118117 @flaky
119- @timed (10 )
118+ @timeout (10 )
120119 def testSendJPGURLPhoto (self ):
121120 '''Test the telegram.Bot sendPhoto method'''
122121 print ('Testing testSendJPGURLPhoto - URL' )
@@ -127,7 +126,7 @@ def testSendJPGURLPhoto(self):
127126 self .assertEqual (message .photo [0 ].file_size , 822 )
128127
129128 @flaky
130- @timed (10 )
129+ @timeout (10 )
131130 def testSendPNGURLPhoto (self ):
132131 '''Test the telegram.Bot sendPhoto method'''
133132 print ('Testing testSendPNGURLPhoto - URL' )
@@ -138,7 +137,7 @@ def testSendPNGURLPhoto(self):
138137 self .assertEqual (message .photo [0 ].file_size , 684 )
139138
140139 @flaky
141- @timed (10 )
140+ @timeout (10 )
142141 def testSendGIFURLPhoto (self ):
143142 '''Test the telegram.Bot sendPhoto method'''
144143 print ('Testing testSendGIFURLPhoto - URL' )
@@ -149,7 +148,7 @@ def testSendGIFURLPhoto(self):
149148 self .assertEqual (message .photo [0 ].file_size , 684 )
150149
151150 @flaky
152- @timed (10 )
151+ @timeout (10 )
153152 def testSendChatAction (self ):
154153 '''Test the telegram.Bot sendChatAction method'''
155154 print ('Testing sendChatAction - ChatAction.TYPING' )
@@ -158,7 +157,7 @@ def testSendChatAction(self):
158157 chat_id = self ._chat_id )
159158
160159 @flaky
161- @timed (10 )
160+ @timeout (10 )
162161 def testGetUserProfilePhotos (self ):
163162 '''Test the telegram.Bot getUserProfilePhotos method'''
164163 print ('Testing getUserProfilePhotos' )
0 commit comments