Merge lp:~dpniel/ubiquity/autopilot_fix_custominstall into lp:ubiquity
Status: | Merged |
---|---|
Merged at revision: | 6126 |
Proposed branch: | lp:~dpniel/ubiquity/autopilot_fix_custominstall |
Merge into: | lp:ubiquity |
Diff against target: |
193 lines (+128/-3) 2 files modified
autopilot/ubiquity_autopilot_tests/emulators/gtkcontrols.py (+73/-0) autopilot/ubiquity_autopilot_tests/tests/__init__.py (+55/-3) |
To merge this branch: | bzr merge lp:~dpniel/ubiquity/autopilot_fix_custominstall |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jean-Baptiste Lallement | Approve | ||
Review via email: mp+208605@code.launchpad.net |
Description of the change
Ok so this should fix the custom install tests and get them passing again. It still needs some further work to get rid of one more sleep.
The changes I made were to generate a dictionary of namedtuples from the all the items in the partition page treeview
Using the Row number as the dictionary key and and column headers as the access names for the named tuple
So now we get a mapped dictionary to any cell in the partition tree by something simple like
>>> table['
which gives us the introspectable object of that cell so we can access any of it properties etc.
This fix doesn't fully use the above atm (soon it will) but basically to fix the current error I use the number of rows in the dict to assert it increments after creating a partition. Instead of blindly sleeping. But for now it's a good thing we can test the number of partitions are correct.
In the end I want to map the partition config file to the dict to assert the tree is displaying partitions correctly but that will take a fair bit more work.
Anyway this gets it going for now :-)
168 + if num == self.part_ table_rows: table_rows + 1:
...
172 + if num is not self.part_
This is inconsistent, in the first comparison you use the operator '==' and 4 lines below the operator 'is'. They have different meanings. '==' would be more appropriate since you're comparing 2 numbers which are the return len()
This line is unused and pyflakes tests will fail get_partition_ table_dict( )
144 + item_table = tree_view.
Okay for the TODO, it is still enhancements to the tests but it is not regressing compared to the previous version
I ran the test on ubuntu-desktop and it works fine.