<s> from __future__ import unicode_literals <EOL> import nose <EOL> from djblets . util . decorators import simple_decorator <EOL> from reviewboard . testing . testcase import TestCase <EOL> __all__ = [ '<STR_LIT>' ] <EOL> _online = None <EOL> def is_online ( ) : <EOL> """<STR_LIT>""" <EOL> global _online <EOL> if _online is None : <EOL> import socket <EOL> try : <EOL> socket . gethostbyname ( '<STR_LIT>' ) <EOL> _online = True <EOL> except : <EOL> _online = False <EOL> return _online <EOL> @ simple_decorator <EOL> def online_only ( test_func ) : <EOL> """<STR_LIT>""" <EOL> def _test ( * args , ** kwargs ) : <EOL> if not is_online ( ) : <EOL> raise nose . SkipTest ( '<STR_LIT>' ) <EOL> return test_func ( * args , ** kwargs ) <EOL> return _test </s>
