def main(): cnt = 0 while True: cnt += 1 print '# testing...' if cnt == 1 else '# test again...' if network.is_internet_on(method=2): print '# Whoa, your net is alive!' play(AUDIO) break else: print '# no connection, waiting...' sleep(10)
def test_is_internet_on(): if IP: assert network.is_internet_on() else: assert not network.is_internet_on()