~ubuntu-branches/ubuntu/precise/software-center/precise-proposed

« back to all changes in this revision

Viewing changes to softwarecenter/testutils.py

  • Committer: Package Import Robot
  • Author(s): Michael Vogt, Michael Vogt, Christopher Kyle Horton, Anthony Lenton, Gary Lasker
  • Date: 2012-01-17 14:19:57 UTC
  • Revision ID: package-import@ubuntu.com-20120117141957-a1hjxi4uxe4il5z1
Tags: 5.1.6
[ Michael Vogt ]
* lp:~mvo/software-center/startup-speed2:
  - additional startup speed improvements, brings up main window
    much more quickly
* lp:~mvo/software-center/fix-server-pagination:    
  - reset reviews "page" when showing a new app

[Christopher Kyle Horton]
* utils/submit_review_gtk3.py:
  - fix crash when submitting a review (LP: #912855)

[ Anthony Lenton ]
* lp:~elachuni/software-center/test_downloader_fix:
  - fix test hang on incorrect proxy settings
* lp:~elachuni/software-center/check-edit-labels:
  - add test for correct labels in "Modify review" mode
  - move main RnR Helper GUI into softwarecenter.backend.rnr 
    to make testing easier

[ Gary Lasker ]
* lp:~gary-lasker/software-center/fix-lp913756:
  - do not add an icon to the Unity launcher for packages that do
    not have an Exec entry in their corresponding desktop file,
    e.g. ubuntu-restricted-extras, wine (LP: #913756)
* lp:~gary-lasker/software-center/search-down-arrow-lp842711:
  - select the first item in the result list when the down
    arrow is pressed during a search (LP: #842711)
* lp:~gary-lasker/software-center/fix-lp896474:
  - fix crash when attempting to install or remove an item
    via the menu (LP: #896474) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
import os
20
20
import subprocess
 
21
import sys
 
22
import tempfile
21
23
import time
22
24
 
 
25
 
23
26
m_dbus = m_polkit = m_aptd = None
24
27
def start_dummy_backend():
25
28
    global m_dbus, m_polkit, m_aptd
133
136
    app._details = details_mock
134
137
    app.get_details = lambda db: app._details
135
138
    return app
 
139
 
 
140
def setup_test_env():
 
141
    """ Setup environment suitable for running the test/* code in a checkout.
 
142
        This includes PYTHONPATH, sys.path and softwarecenter.paths.datadir.
 
143
    """
 
144
    basedir = os.path.dirname(__file__)
 
145
    while not os.path.exists(
 
146
        os.path.join(basedir, "softwarecenter/__init__.py")):
 
147
        basedir = os.path.abspath(os.path.join(basedir, ".."))
 
148
    #print basedir, __file__, os.path.realpath(__file__)
 
149
    sys.path.insert(0, basedir)
 
150
    os.environ["PYTHONPATH"] = basedir
 
151
    import softwarecenter.paths
 
152
    softwarecenter.paths.datadir = os.path.join(basedir, "data")
 
153
    softwarecenter.paths.SOFTWARE_CENTER_CACHE_DIR = tempfile.mkdtemp()