test_infographics_themes may break if we do not ship custom theme

Bug #1276369 reported by Alex Chiang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
The Savilerow project
Won't Fix
Undecided
Unassigned

Bug Description

    def test_theme_dir_in_datadirs(self):
        """
        Downstreams may customize the color scheme of the infographic on
        the welcome screen by shipping an XML file.

        This test ensures that the XML file has been properly installed
        in the system.
        """
        themefilefound = False
        data_dirs = subprocess.check_output(['initctl', 'get-env',
                                             'XDG_DATA_DIRS']).split(':')
        for dir in data_dirs:
            # We use a relative path in `themefile` because we don't
            # necessarily know the full path to the custom XDG data
            # directory. Currently, the path is set to /custom/xdg/data
            # in ubuntu-touch-customization-hooks, but that could
            # theoretically change. So use the relative path, and glom
            # it together with every XDG_DATA_DIR path we discover in
            # the environment and test for its presence. Not spectacular
            # but it works.
            #
            # Note that initctl get-env adds a \n to the end of the
            # output so we need to strip() it out
            if os.path.isfile(os.path.join(dir.strip(), themefile)):
                themefilefound = True
        self.assertTrue(themefilefound)

Based on the way this test is written, it seems like it assumes we MUST ship a custom.xml, else it will fail on the assertTrue()

What if a downstream chooses not to ship such a file? This test will then fail.

The test needs to handle that situation.

Revision history for this message
Yuan-Chen Cheng (ycheng-twn) wrote :

too old

Changed in savilerow:
status: New → Won't Fix
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.