<s> import disq <EOL> def test_connection_from_url ( ) : <EOL> c = disq . Disque . from_url ( '<STR_LIT>' ) <EOL> assert c . hello ( ) <EOL> assert c . __repr__ ( ) . startswith ( '<STR_LIT>' ) <EOL> def test_connection_switch_workload ( ) : <EOL> qname = '<STR_LIT>' <EOL> first = disq . Disque ( port = <NUM_LIT> , record_job_origin = True ) <EOL> for _ in range ( <NUM_LIT> ) : <EOL> first . addjob ( qname , '<STR_LIT>' ) <EOL> second = disq . Disque ( port = <NUM_LIT> , record_job_origin = True ) <EOL> for _ in range ( <NUM_LIT:10> ) : <EOL> second . addjob ( qname , '<STR_LIT>' ) <EOL> conn , node = second . _get_connection ( '<STR_LIT>' ) <EOL> assert node == second . default_node <EOL> second . _release_connection ( conn , node ) <EOL> for _ in range ( <NUM_LIT:100> ) : <EOL> second . getjob ( qname ) <EOL> assert first . default_node in second . _job_score . keys ( ) <EOL> conn , node = second . _get_connection ( '<STR_LIT>' ) <EOL> assert node != second . default_node <EOL> assert node == first . default_node <EOL> second . _release_connection ( conn , node ) <EOL> conn , node = second . _get_connection ( '<STR_LIT>' ) <EOL> assert node == second . default_node <EOL> assert node != first . default_node <EOL> second . _release_connection ( conn , node ) </s>
