File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -501,7 +501,7 @@ def from_csgo_friend_code(code, universe=EUniverse.Public):
501501 :return: SteamID instance
502502 :rtype: :class:`.SteamID` or :class:`None`
503503 """
504- if not re .match (r'^[' + _csgofrcode_chars + '\-]{10}$' , code ):
504+ if not re .match (r'^[' + _csgofrcode_chars + r '\-]{10}$' , code ):
505505 return None
506506
507507 code = ('AAAA-' + code ).replace ('-' , '' )
@@ -574,7 +574,7 @@ def steam64_from_url(url, http_timeout=30):
574574 # group profiles
575575 else :
576576 text = web .get (match .group ('clean_url' ), timeout = http_timeout ).text
577- data_match = re .search ("OpenGroupChat\( *'(?P<steamid>\d+)'" , text )
577+ data_match = re .search (r "OpenGroupChat\( *'(?P<steamid>\d+)'" , text )
578578
579579 if data_match :
580580 return int (data_match .group ('steamid' ))
Original file line number Diff line number Diff line change @@ -337,6 +337,16 @@ def test_steam64_from_url_timeout(self, mrs_mock):
337337 mm .get .side_effect = requests .exceptions .ReadTimeout ('test' )
338338 self .assertIsNone (steamid .steam64_from_url ("https://steamcommunity.com/id/timeout_me" ))
339339
340+ @mock .patch ('steam.steamid.make_requests_session' )
341+ def test_steam64_from_url_group_chat_markup (self , mrs_mock ):
342+ mm = mrs_mock .return_value = mock .MagicMock ()
343+ mm .get .return_value .text = "OpenGroupChat( '103582791429521412'"
344+
345+ self .assertEqual (
346+ steamid .steam64_from_url ("https://steamcommunity.com/groups/Valve" ),
347+ 103582791429521412
348+ )
349+
340350 def test_steam64_from_url (self ):
341351 def scrub_req (r ):
342352 r .headers .pop ('Cookie' , None )
You can’t perform that action at this time.
0 commit comments