Merge lp:~gary-lasker/software-center/recommender-unit-test-updates into lp:software-center
Status: | Merged |
---|---|
Merged at revision: | 3131 |
Proposed branch: | lp:~gary-lasker/software-center/recommender-unit-test-updates |
Merge into: | lp:software-center |
Diff against target: |
49 lines (+15/-6) 2 files modified
tests/gtk3/test_catview.py (+4/-1) tests/gtk3/windows.py (+11/-5) |
To merge this branch: | bzr merge lp:~gary-lasker/software-center/recommender-unit-test-updates |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
software-store-developers | 2012-08-27 | Pending | |
Review via email:
|
Commit message
* lp:~gary-lasker/software-center/recommender-unit-test-updates:
- update unit test to accomodate the new subcategory that has been
added to the themes and tweaks category
Description of the change
When choosing a subcategory for get_test_
Many thanks for your review!
Michael Vogt (mvo) wrote : | # |
Gary Lasker (gary-lasker) wrote : | # |
Hi Michael, thanks! So, the way I see it, get_test_
So, for that reason, I think that it's best that this is set the test category unambiguously right in the get_test_
I am happy to add a comment in the code to make it clearer that the "Internet" category will be returned by default, this may help for any new tests that rely on knowing the subcategory. But I prefer to leave the code as I've made it in my branch.
Michael Vogt (mvo) wrote : | # |
On Tue, Aug 28, 2012 at 02:27:20PM -0000, Gary Lasker wrote:
> Hi Michael, thanks! So, the way I see it, get_test_
Thanks for your comments, I probably did not express myself very well,
I'm all for making it deterministic :) There is no disagreement here.
In the old days when the code was originally writen to get the test
window with the catview it did not mater what category was
selected, iirc it just tested basic properties like if there was a
subcategory window visilbe or not. At some later point it started to
reply on a specific category so for that test-case, it needs to be
deterministic and one way of archiving this is to make it explicit in
the test that needs it. We could use something like:
get_test_
there and it would be deterministic and also clear that this tests
needs the category (as its requesting it explicitely).
> So, for that reason, I think that it's best that this is set the test category unambiguously right in the get_test_
Indeed, no disagreement here :) We do not want to go back to the old
system. Its unfortunately not entirely trivial (or not as trivial as
when its created) to set the subcategory after the window is created
(it would have to do a iteration over the categories in the test
itself) so having something like get_test_
selected_
> I am happy to add a comment in the code to make it clearer that the "Internet" category will be returned by default, this may help for any new tests that rely on knowing the subcategory. But I prefer to leave the code as I've made it in my branch.
I think a comment would be needed in get_test_
that tests will break if that category gets changed.
Thanks,
Michael
- 3128. By Gary Lasker on 2012-08-28
-
make the category selectable in get_test_
window_ catview and use use this facility for test_catview.py's Recommendations TestCase - 3129. By Gary Lasker on 2012-08-28
-
since get_test_
window_ catview *requires* a category that includes subcategories, we enforce this requirement with a ValueError
Gary Lasker (gary-lasker) wrote : | # |
Ok, should be all fixed up per your suggestion. Note that since the test call get_test_
Thanks again!
Michael Vogt (mvo) wrote : | # |
On Tue, Aug 28, 2012 at 09:37:21PM -0000, Gary Lasker wrote:
> Ok, should be all fixed up per your suggestion. Note that since the test call get_test_
Woah, this is very nice now, thanks for this!
Thanks for your branch.
I looked at the code and I it appears that the place that relies on a specific subcategory is ed_for_ you_display_ recommendations _opted_ in". So I think instead of hardcoding it in window.py view.set_ subcategory( ) or by window_ catview( ) so that in Recommendations TestCase we can explicitely specify
"test_recommend
we should either set it in the test that needs it explicitely via self.subcat_
passing a parameter to get_test_
that the subcategory is required. This makes the connection of what needs it more explicit and window.py more
generic. Could you please update that?