diff options
| author | Thomi Richards <thomi.richards@canonical.com> | 2012-07-17 10:50:27 +1200 |
|---|---|---|
| committer | Thomi Richards <thomi.richards@canonical.com> | 2012-07-17 10:50:27 +1200 |
| commit | c839b08d2655bbe4ffd6852233f228fa1cffcc83 (patch) | |
| tree | 8567f3f13692d7f32d228dfcc1b4fd04cb6d732b /tests/autopilot | |
| parent | f62b67cedb5819d3e120c72e8b20a486b74a9a0f (diff) | |
Fixed failing test.
(bzr r2502.1.2)
Diffstat (limited to 'tests/autopilot')
| -rw-r--r-- | tests/autopilot/unity/tests/test_panel.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/autopilot/unity/tests/test_panel.py b/tests/autopilot/unity/tests/test_panel.py index e7e629a4e..b057dad5a 100644 --- a/tests/autopilot/unity/tests/test_panel.py +++ b/tests/autopilot/unity/tests/test_panel.py @@ -206,7 +206,18 @@ class PanelTitleTests(PanelTestsBase): sleep(.25) self.keyboard.type("/tmp/autopilot-awesome-test.txt") self.keyboard.press_and_release("Return") - self.addCleanup(os.remove, "/tmp/autopilot-awesome-test.txt") + + # We need to close the window BEFORE removing the file, or gedit doesn't + # close properly, since it's asking us if we want to "exit without saving". + # Cleanup actionsa re executed in LIFO order, so we first add a cleanup + # action that sleeps a few seconds (to wait for the window to close), and + # then removed the file... + def cleanup_file(): + sleep(5) + os.remove("/tmp/autopilot-awesome-test.txt") + self.addCleanup(cleanup_file) + #... and an action to close the window. + self.addCleanup(text_win.close) self.assertThat(lambda: text_win.title, Eventually(NotEquals(old_title))) self.assertThat(self.panel.title, Eventually(Equals(text_win.title))) |
