Merge lp://qastaging/~sevilerow-team/sevilerow/fonts_test into lp://qastaging/~sevilerow-team/sevilerow/tests

Proposed by Sean Feole
Status: Merged
Approved by: Sean Feole
Approved revision: 24
Merged at revision: 23
Proposed branch: lp://qastaging/~sevilerow-team/sevilerow/fonts_test
Merge into: lp://qastaging/~sevilerow-team/sevilerow/tests
Diff against target: 53 lines (+32/-12)
2 files modified
tests/test_customized_applications.py (+0/-12)
tests/test_fonts.py (+32/-0)
To merge this branch: bzr merge lp://qastaging/~sevilerow-team/sevilerow/fonts_test
Reviewer Review Type Date Requested Status
Scott Sweeny (community) Approve
Matt Fischer (community) Approve
Sean Feole Needs Resubmitting
Review via email: mp+190762@code.qastaging.launchpad.net

Description of the change

Added test for fonts. Tested on my device and appears to be working.
(Right now there is no fonts directory so the test will fail)

Otherwise anything in /custom/usr/share/fonts will need to be present in fontconfig (fc-list) otherwise the test will fail.

To post a comment you must log in.
Revision history for this message
Matt Fischer (mfisch) wrote :

Looks good like we discussed +1

review: Approve
Revision history for this message
Sean Feole (sfeole) wrote :

Holding off on the merge until I test with fonts and make some additional changes that were brought up in discussion about the MP

Revision history for this message
Sean Feole (sfeole) wrote :

Test with fonts on the Mako

Revision history for this message
Scott Sweeny (ssweeny) wrote :

As we discussed on IRC the logic of the final loop should be something more like:

for font in fontlist_string:
    assertTrue(font in installed_fonts)

review: Needs Fixing
Revision history for this message
Scott Sweeny (ssweeny) wrote :

Also, the test for /custom/usr/share/fonts will fail with the current tarball.

Instead why not wrap the whole test in if (os.path.exists(fontspath)) since if we don't put fonts in there we don't need to test them?

review: Needs Fixing
Revision history for this message
Sean Feole (sfeole) wrote :

This also needs to be fixed so that the test will not fail if no directory is present, perhaps simply warn the user

24. By Sean Feole

Updated test_fonts.py and removed test_customized_app test

Revision history for this message
Sean Feole (sfeole) wrote :

I pushed a new update, rev 24. This includes the following changes.

1.) Remove test_customized_applications.py: This test has been replaced by test_webbrowser_settings.py

2.) Fixed test_fonts.py by making the changes suggested from sweeney

3.) Tested the script using the /usr/share/fonts on the Mako device, this directory contains a set of "truetype" fonts, all of which are currently in use and are present in "fc-list". After testing, I switched the default path to "/custom/usr/share/fonts" (see line 26) and re-ran the script. The test recognized that there was no directory (/custom/usr/share/fonts), see item #4

4.) Made the test Pass regardless if the fontspath is present or not, it the custom fonts path is NOT present, "No Custom Fonts Found" will be recorded in the test logs.

5.) Line 50 contains "self.assertIn(font, installed_fonts)" I'm using this method rather than "self.assertTrue(font in installed_fonts" because if there is a failure the test will output the missing string. For Example, please see: https://pastebin.canonical.com/99149/

review: Needs Resubmitting
Revision history for this message
Matt Fischer (mfisch) wrote :

Approved after IRC discussion.

review: Approve
Revision history for this message
Scott Sweeny (ssweeny) wrote :

This is much better. Nice work.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: