~aaronp/software-center/review-refactor

« back to all changes in this revision

Viewing changes to tests/utils.py

  • Committer: Aaron Peachey
  • Date: 2012-08-28 10:48:03 UTC
  • mfrom: (2822.2.305 trunk)
  • Revision ID: alpeachey@gmail.com-20120828104803-3qrqi07yjds396zo
mergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
)
45
45
from softwarecenter.ui.gtk3.utils import get_sc_icon_theme
46
46
from softwarecenter.utils import get_uuid
 
47
from softwarecenter.db.update import update_from_app_install_data
 
48
 
47
49
 
48
50
m_dbus = m_polkit = m_aptd = None
49
51
 
107
109
    return db
108
110
 
109
111
 
 
112
def get_test_db_from_app_install_data(datadir):
 
113
    db = xapian.inmemory_open()
 
114
    cache = get_pkg_info()
 
115
    cache.open()
 
116
    res = update_from_app_install_data(db, cache, datadir)
 
117
    if res is False:
 
118
        raise AssertionError("Failed to build db from '%s'" % datadir)
 
119
    return db
 
120
 
 
121
 
110
122
def get_test_install_backend():
111
123
    backend = get_install_backend()
112
124
    return backend
395
407
        """Return (recommended, suggested) addons for 'pkgname'."""
396
408
        return ([], [])
397
409
 
398
 
    def get_total_size_on_install(self, pkgname, addons_to_install,
 
410
    def query_total_size_on_install(self, pkgname, addons_to_install,
399
411
                                  addons_to_remove, archive_suite):
400
 
        """Return a fake (total_download_size, total_install_size) result."""
401
 
        return (0, 0)
 
412
        """Emit a fake signal "query-total-size-on-install-done" """
 
413
        self.emit("query-total-size-on-install-done", None, 0, 0)