unittest FAIL: test_pages_fit_on_a_netbook (test_gtkui.TestFrontend)

Bug #1003890 reported by Dimitri John Ledkov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubiquity (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

$ cd ubiquity
$ cd gui
$ ln -s ../pixmaps & cd ../
$ ./tests/run
======================================================================
FAIL: test_pages_fit_on_a_netbook (test_gtkui.TestFrontend)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tdlk/canonical/ubiquity/tests/test_gtkui.py", line 78, in test_pages_fit_on_a_netbook
    self.assertLessEqual(alloc.height, 500)
AssertionError: 530 not less than or equal to 500

----------------------------------------------------------------------

The problem is that .ui files are referencing relative paths for pixmaps which do not exist when run from unit-tests and during normal runs generate Gtk.Warnings similar to:

(run:21508): Gtk-WARNING **: Could not load image '../pixmaps/cd_in_tray.png': Failed to open file 'gui/gtk/../pixmaps/cd_in_tray.png': No such file or directory

This does not happen with default_icon, because PIXMAPS environment variable is used to load the images.

A while ago, there was a gtk api for search-dirs of e.g. images/content which I used in another project to source images both from the source tree & global/real install paths. need to look it up again.

Related branches

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

The gtk+ish way to deal with this probably is:
* use iconfactory
* add all icons as iconsets into a factory
* stop hardcoding /usr/share/pixmaps
* stop hardcoding ../pixmaps/
* fetch all icons/images using 'symbolic' names
* during testsuite set path / add path to the theme from source code or installed path

As a side-effect:
* ubiquity becomes fully themable, as in every single image can be replaced at runtime with a theme, which maybe desirable for respins.

Changed in ubiquity (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubiquity - 2.11.25

---------------
ubiquity (2.11.25) quantal; urgency=low

  * partAsk.ui, partCrypto.ui: Normalise widget names
  * Sub-class Gtk.Builder to add get_object_ids method
  * partAdvanced.ui: Refactor advanced partitioning UI (LP: #1042642)
  * partAdvanced.ui: Add LVM & Crypto UI but hide by default
  * Activate the first option by default on the ask page (LP: #1043822)
  * Make the "Use LVM" checkbox visible by default (LP: #1042639)
  * Remove the experimental --enable-partauto-lvm, not needed anymore
  * Create gui/pixmaps -> ../pixmaps symlink, for unit-tests
    to find images (LP: #1003890)
  * Adjust translations & unit-tests for the UI widget renames
  * Add new strings for future advanced LVM & Crypto UI
  * Update translation templates
 -- Dmitrijs Ledkovs <email address hidden> Thu, 30 Aug 2012 18:45:25 +0100

Changed in ubiquity (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.