Fix unit test failures when the host has no internet connection.

Review Request #4569 — Created Sept. 15, 2013 and submitted

Information

Review Board
master

Reviewers

Fix unit test failures when the host has no internet connection.

One annoying aspect of working on planes is that several of the unit tests fail
in ugly ways if the host has no internet access. I've added a check that tries
to resolve the hostname for google.com and skips any tests that require network
access.

Eventually, we should fix these tests to use mocks running on the host to
completely isolate us from third-party servers and internet connections.

Ran unit tests whilst in-flight.

Description From Last Updated

'P4Error' imported but unused

reviewbotreviewbot

'P4Error' imported but unused

reviewbotreviewbot

'find_module' imported but unused

reviewbotreviewbot

Instead of this going into every test, how about an @online_only decorator or something that does this?

chipx86chipx86
reviewbot
  1. This is a review from Review Bot.
    Tool: PEP8 Style Checker
    Processed Files:
    reviewboard/scmtools/tests.py
    reviewboard/testing/init.py
    reviewboard/ssh/errors.py
    Ignored Files:

  2. 
      
reviewbot
  1. This is a review from Review Bot.
    Tool: Pyflakes
    Processed Files:
    reviewboard/scmtools/tests.py
    reviewboard/testing/init.py
    reviewboard/ssh/errors.py
    Ignored Files:

  2. reviewboard/scmtools/tests.py (Diff revision 1)
     
     
    Show all issues

    'P4Error' imported but unused

  3. 
      
david
reviewbot
  1. This is a review from Review Bot.
    Tool: PEP8 Style Checker
    Processed Files:
    reviewboard/scmtools/tests.py
    reviewboard/testing/init.py
    reviewboard/ssh/errors.py
    Ignored Files:

  2. 
      
reviewbot
  1. This is a review from Review Bot.
    Tool: Pyflakes
    Processed Files:
    reviewboard/scmtools/tests.py
    reviewboard/testing/init.py
    reviewboard/ssh/errors.py
    Ignored Files:

  2. reviewboard/scmtools/tests.py (Diff revision 2)
     
     
    Show all issues

    'P4Error' imported but unused

  3. 
      
david
reviewbot
  1. This is a review from Review Bot.
    Tool: PEP8 Style Checker
    Processed Files:
    reviewboard/scmtools/tests.py
    reviewboard/testing/init.py
    reviewboard/ssh/errors.py
    Ignored Files:

  2. 
      
reviewbot
  1. This is a review from Review Bot.
    Tool: Pyflakes
    Processed Files:
    reviewboard/scmtools/tests.py
    reviewboard/testing/init.py
    reviewboard/ssh/errors.py
    Ignored Files:

  2. reviewboard/scmtools/tests.py (Diff revision 3)
     
     
    Show all issues

    'find_module' imported but unused

  3. 
      
david
reviewbot
  1. This is a review from Review Bot.
    Tool: PEP8 Style Checker
    Processed Files:
    reviewboard/scmtools/tests.py
    reviewboard/testing/init.py
    reviewboard/ssh/errors.py
    Ignored Files:

  2. 
      
reviewbot
  1. This is a review from Review Bot.
    Tool: Pyflakes
    Processed Files:
    reviewboard/scmtools/tests.py
    reviewboard/testing/init.py
    reviewboard/ssh/errors.py
    Ignored Files:

  2. 
      
chipx86
  1. 
      
  2. reviewboard/scmtools/tests.py (Diff revision 4)
     
     
     
    Show all issues

    Instead of this going into every test, how about an @online_only decorator or something that does this?

  3. 
      
david
chipx86
  1. Ship It!

  2. 
      
david
Review request changed
Status:
Completed
Change Summary:

Pushed to master (9416b03)