~nataliabidart/software-center/winged-migration

« back to all changes in this revision

Viewing changes to softwarecenter/ui/gtk3/panes/availablepane.py

  • Committer: Natalia B. Bidart
  • Date: 2012-05-30 18:39:55 UTC
  • mto: This revision was merged to the branch mainline in revision 3030.
  • Revision ID: natalia.bidart@canonical.com-20120530183955-zbnjczayktmmg5tv
- Initial test cleanup:
  - Renamed test/ dir to tests/.
  - Isolated test code into tests/ directory, including moving all the
    get_test_window_foo from the gtk3 production modules to
    tests/gtk3/windows.py module.
  - Removed all the calls to Gtk.main() in gtk3 tests since that blocks the
    execution of the suite.
  - Pep8 and pyflakes fixes in the files already modified in this branch.
  - Minor bug fix in the softwarecenter/log.py module when trying to create a
    log dir with proper perms.

Show diffs side-by-side

added added

removed removed

Lines of Context:
811
811
        # and the subcat view as well...
812
812
        if self.subcategories_view:
813
813
            self.subcategories_view.refresh_apps()
814
 
 
815
 
 
816
 
def get_test_window():
817
 
    from softwarecenter.testutils import (get_test_db,
818
 
                                          get_test_datadir,
819
 
                                          get_test_install_backend,
820
 
                                          get_test_gtk3_viewmanager,
821
 
                                          get_test_pkg_info,
822
 
                                          get_test_gtk3_icon_cache,
823
 
                                          )
824
 
    # needed because available pane will try to get it
825
 
    vm = get_test_gtk3_viewmanager()
826
 
    vm  # make pyflakes happy
827
 
    db = get_test_db()
828
 
    cache = get_test_pkg_info()
829
 
    datadir = get_test_datadir()
830
 
    icons = get_test_gtk3_icon_cache()
831
 
    backend = get_test_install_backend()
832
 
 
833
 
    # create global AppManager instance
834
 
    from softwarecenter.ui.gtk3.session.appmanager import ApplicationManager
835
 
    ApplicationManager(db, backend, icons)
836
 
 
837
 
    navhistory_back_action = Gtk.Action("navhistory_back_action", "Back",
838
 
        "Back", None)
839
 
    navhistory_forward_action = Gtk.Action("navhistory_forward_action",
840
 
        "Forward", "Forward", None)
841
 
 
842
 
    w = AvailablePane(cache, db, 'Ubuntu', icons, datadir,
843
 
        navhistory_back_action, navhistory_forward_action)
844
 
    w.init_view()
845
 
    w.show()
846
 
 
847
 
    win = Gtk.Window()
848
 
    win.connect("destroy", Gtk.main_quit)
849
 
    win.add(w)
850
 
    win.set_size_request(800, 600)
851
 
    win.show_all()
852
 
 
853
 
    # this is used later in tests
854
 
    win.set_data("pane", w)
855
 
 
856
 
    return win
857
 
 
858
 
if __name__ == "__main__":
859
 
    win = get_test_window()
860
 
    Gtk.main()