Call launch_test_application outside AutopilotTestCase
Bug #1291531 reported by
Víctor R. Ruiz
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Autopilot |
Fix Released
|
Medium
|
Unassigned | ||
autopilot (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
While refactoring the test code of some applications, we are moving calls outside the tests to helpers.py. Right now, to use launch_
Related branches
lp:~nuclearbob/autopilot/launch-function
- PS Jenkins bot: Approve (continuous-integration)
- Thomi Richards (community): Approve
- Max Brustkern (community): Needs Resubmitting
-
Diff: 1274 lines (+661/-297)11 files modifiedautopilot/application/__init__.py (+1/-1)
autopilot/application/_launcher.py (+216/-45)
autopilot/testcase.py (+23/-71)
autopilot/tests/acceptance/test_vis_main.py (+5/-34)
autopilot/tests/functional/test_ap_apps.py (+9/-3)
autopilot/tests/functional/test_application_mixin.py (+0/-22)
autopilot/tests/unit/test_application_launcher.py (+323/-121)
autopilot/tests/unit/test_testcase.py (+50/-0)
debian/control (+1/-0)
docs/api/autopilot.application.rst (+5/-0)
docs/tutorial/advanced_autopilot.rst (+28/-0)
Superseded
for merging
into
lp:autopilot
- Autopilot Hackers: Pending requested
-
Diff: 653 lines (+153/-160)17 files modifiedautopilot/application/_launcher.py (+12/-20)
autopilot/exceptions.py (+4/-3)
autopilot/introspection/__init__.py (+5/-1)
autopilot/introspection/dbus.py (+3/-2)
autopilot/testcase.py (+72/-40)
autopilot/tests/functional/test_autopilot_functional.py (+24/-33)
autopilot/tests/unit/test_application_launcher.py (+6/-38)
autopilot/tests/unit/test_types.py (+1/-1)
bin/autopilot3-sandbox-run (+1/-3)
debian/control (+1/-1)
debian/python3-autopilot.install (+1/-0)
docs/api/exceptions.rst (+5/-0)
docs/tutorial/advanced_autopilot.rst (+8/-8)
docs/tutorial/getting_started.rst (+4/-7)
docs/tutorial/good_tests.rst (+1/-1)
docs/tutorial/what_is_autopilot.rst (+4/-1)
setup.py (+1/-1)
Changed in autopilot: | |
status: | New → Triaged |
importance: | Undecided → Medium |
description: | updated |
Changed in autopilot: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
We would like _launch_ test_applicatio n to be a function in a module, instead of a method in AutopilotTestCase.
With that, we would be able to make helper objects that encapsulate the logic about how to open them. We could just instantiate something like
system_settings_app = ubuntu_ system_ settings. SystemSettingsA pp(launch= True) from any test that needs to interact with system settings.
We could wrap that into a fixture, so the app is closed when it's no longer needed and all the changes to the settings are reverted.
But currently this doesn't look as nice as it should because we need to pass the test case object as a parameter to everything with no real reason.