<s> import socket <EOL> import unittest <EOL> def test_redis_or_raise_skiptest ( host = "<STR_LIT:localhost>" , port = <NUM_LIT> ) : <EOL> s = socket . socket ( ) <EOL> try : <EOL> s . connect ( ( host , port ) ) <EOL> except socket . error : <EOL> raise unittest . SkipTest ( "<STR_LIT>" % ( host , <EOL> port ) ) <EOL> def test_redis_uds_or_raise_skiptest ( uds = "<STR_LIT>" ) : <EOL> s = socket . socket ( socket . AF_UNIX , socket . SOCK_STREAM ) <EOL> try : <EOL> s . connect ( uds ) <EOL> except socket . error : <EOL> raise unittest . SkipTest ( "<STR_LIT>" % uds ) </s>
