@@ -184,7 +184,7 @@ def test_not_url_tld_too_short(self):
184
184
self .assertEqual (result .html , u'Is http://tld-too-short.x a valid URL?' )
185
185
self .assertEqual (result .urls , [])
186
186
187
- def test_all_not_break_url_at (self ):
187
+ def test_all_not_break_url_at2 (self ):
188
188
result = self .parser .parse (u'http://www.flickr.com/photos/29674651@N00/4382024406' )
189
189
self .assertEqual (result .html , u'<a href="http://www.flickr.com/photos/29674651@N00/4382024406">http://www.flickr.com/photo...</a>' )
190
190
self .assertEqual (result .urls , [u'http://www.flickr.com/photos/29674651@N00/4382024406' ])
@@ -529,7 +529,7 @@ def test_list_not_slash_space(self):
529
529
self .assertEqual (result .users , [u'username' ])
530
530
self .assertEqual (result .lists , [])
531
531
532
- def test_list_beginning (self ):
532
+ def test_list_beginning2 (self ):
533
533
result = self .parser .parse (u'@username/list' )
534
534
self .assertEqual (result .html , u'<a href="http://twitter.com/username/list">@username/list</a>' )
535
535
self .assertEqual (result .lists , [(u'username' , u'list' )])
@@ -565,16 +565,19 @@ def test_spans_in_tweets(self):
565
565
result = self .parser .parse (u'Coca-Cola Hits 50 Million Facebook Likes http://bit.ly/QlKOc7' )
566
566
self .assertEqual (result .urls , [('http://bit.ly/QlKOc7' , (40 , 61 ))])
567
567
568
- result = self .parser .parse (u' #ABillionReasonsToBelieveInAfrica ARISE MAG.FASHION WEEK NY! Tsemaye B,Maki Oh,Tiffany Amber, Ozwald.Showin NY reasons2beliv @CocaCola_NG' )
568
+ result = self .parser .parse (u' #ABillionReasonsToBelieveInAfrica ARISE MAG.FASHION WEEK NY! Tsemaye B,Maki Oh,Tiffany Amber, Ozwald.Showin NY reasons2beliv @CocaCola_NG' , html = False )
569
569
self .assertEqual (result .urls , [])
570
570
self .assertEqual (result .tags , [(u'ABillionReasonsToBelieveInAfrica' , (0 , 34 ))])
571
571
self .assertEqual (result .users , [(u'CocaCola_NG' , (126 , 138 ))])
572
572
573
- result = self .parser .parse (u'Follow @CokeZero & Retweet for a chance to win @EASPORTS @EANCAAFootball 13 #GameOn #ad Rules: http://bit.ly/EANCAA' )
573
+ result = self .parser .parse (u'Follow @CokeZero & Retweet for a chance to win @EASPORTS @EANCAAFootball 13 #GameOn #ad Rules: http://bit.ly/EANCAA' , html = False )
574
574
self .assertEqual (result .urls , [(u'http://bit.ly/EANCAA' , (94 , 115 ))])
575
575
self .assertEqual (result .users , [(u'CokeZero' , (7 , 16 )), (u'EASPORTS' , (47 , 56 )), (u'EANCAAFootball' , (57 , 72 ))])
576
- self .assertEqual (result .tags , [(u'GameOn' , (207 , 215 )), (u'ad' , (215 , 219 ))])
576
+ self .assertEqual (result .tags , [(u'GameOn' , (75 , 83 )), (u'ad' , (83 , 87 ))])
577
577
578
+ def test_users_in_tweets (self ):
579
+ result = self .parser .parse (u'Follow @CokeZero & Retweet for a chance to win @EASPORTS @EANCAAFootball 13 #GameOn #ad Rules: http://bit.ly/EANCAA @someone' , html = False )
580
+ self .assertEqual (result .users , [(u'CokeZero' , (7 , 16 )), (u'EASPORTS' , (47 , 56 )), (u'EANCAAFootball' , (57 , 72 )), (u'someone' , (116 , 124 ))])
578
581
579
582
# Test it!
580
583
if __name__ == '__main__' :
0 commit comments