<s> import unittest <EOL> from spyder . core . constants import CURI_EXTRACTED_URLS <EOL> from spyder . core . settings import Settings <EOL> from spyder . processor . stripsessions import StripSessionIds <EOL> from spyder . thrift . gen . ttypes import CrawlUri <EOL> class StripSessionIdsTest ( unittest . TestCase ) : <EOL> def test_that_stripping_session_stuff_works ( self ) : <EOL> s = StripSessionIds ( Settings ( ) ) <EOL> url = "<STR_LIT>" <EOL> self . assertEqual ( "<STR_LIT>" , <EOL> s . _remove_session_ids ( url ) ) <EOL> url = "<STR_LIT>" <EOL> self . assertEqual ( "<STR_LIT>" , <EOL> s . _remove_session_ids ( url ) ) <EOL> url = "<STR_LIT>" <EOL> self . assertEqual ( "<STR_LIT>" , <EOL> s . _remove_session_ids ( url ) ) <EOL> url = "<STR_LIT>" <EOL> self . assertEqual ( "<STR_LIT>" , <EOL> s . _remove_session_ids ( url ) ) <EOL> def test_that_with_uri_works ( self ) : <EOL> s = StripSessionIds ( Settings ( ) ) <EOL> urls = [ "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> ] <EOL> curi = CrawlUri ( ) <EOL> curi . optional_vars = { CURI_EXTRACTED_URLS : "<STR_LIT:\n>" . join ( urls ) } <EOL> curi = s ( curi ) <EOL> clean_urls = curi . optional_vars [ CURI_EXTRACTED_URLS ] . split ( '<STR_LIT:\n>' ) <EOL> for u in clean_urls : <EOL> self . assertEqual ( "<STR_LIT>" , u ) </s>
