~afb/smart/solaris

« back to all changes in this revision

Viewing changes to test

  • Committer: Anders F Bjorklund
  • Date: 2009-03-11 10:07:49 UTC
  • mfrom: (856.1.8 bugfix)
  • Revision ID: afb@users.sourceforge.net-20090311100749-g9n4xrouwqmbam8s
merge changes from trunk, via bugfix

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
import os
29
29
 
30
30
from smart.option import OptionParser
31
 
from smart import init, const, interface
 
31
from smart import init, const, interface, iface
32
32
from smart import *
33
33
 
34
34
import tests
85
85
 
86
86
def main():
87
87
 
 
88
    # We don't want to use proxies for the local tests.
 
89
    for proxy_type in "http", "https", "ftp":
 
90
        variable_name = proxy_type + "_proxy"
 
91
        if variable_name in os.environ:
 
92
            del os.environ[variable_name]
 
93
 
88
94
    datadir = tempfile.mkdtemp()
89
95
 
90
96
    try:
91
97
        const.DISTROFILE = "/non-existent/file"
92
 
        interface.getScreenWidth = lambda: 80
93
98
 
94
99
        tests.ctrl = init(datadir=datadir)
95
100
        opts = parse_options(sys.argv[1:])
96
101
 
 
102
        # Let's use an interface which doesn't output progress.
 
103
        iface.object = interface.Interface(tests.ctrl)
 
104
 
97
105
        runner = unittest.TextTestRunner()
98
106
        loader = unittest.TestLoader()
99
107
        doctest_flags = doctest.ELLIPSIS
124
132
 
125
133
                shutil.rmtree(datadir)
126
134
                os.mkdir(datadir)
 
135
                from smart import sysconf
 
136
                if sysconf.get("channels"):
 
137
                    print "GOT CHANNELS:", sysconf.get("channels")
127
138
 
128
139
        if doctests:
129
140
            print "Running doctests..."