Back to index

apport  2.4
Classes | Functions | Variables
test_backend_apt_dpkg Namespace Reference

Classes

class  T

Functions

def _has_internet

Variables

tuple impl = imp.load_source('', 'backends/packaging-apt-dpkg.py')

Function Documentation

Return if there is sufficient network connection for the tests.

This checks if http://ddebs.ubuntu.com/ can be downloaded from, to check if
we can run the online tests.

Definition at line 11 of file test_backend_apt_dpkg.py.

00011 
00012 def _has_internet():
00013     '''Return if there is sufficient network connection for the tests.
00014 
00015     This checks if http://ddebs.ubuntu.com/ can be downloaded from, to check if
00016     we can run the online tests.
00017     '''
00018     if os.environ.get('SKIP_ONLINE_TESTS'):
00019         return False
00020     if _has_internet.cache is None:
00021         _has_internet.cache = False
00022         try:
00023             f = urllib.request.urlopen('http://ddebs.ubuntu.com/dbgsym-release-key.asc', timeout=30)
00024             if f.readline().startswith(b'-----BEGIN PGP'):
00025                 _has_internet.cache = True
00026         except (IOError, urllib.error.URLError):
00027             pass
00028     return _has_internet.cache
00029 
00030 _has_internet.cache = None
00031 

Here is the caller graph for this function:


Variable Documentation

tuple test_backend_apt_dpkg.impl = imp.load_source('', 'backends/packaging-apt-dpkg.py')

Definition at line 6 of file test_backend_apt_dpkg.py.