Merge lp:~om26er/ubuntu-autopilot-tests/test_fixtures into lp:ubuntu-autopilot-tests/ubuntu-experience-tests

Proposed by Omer Akram
Status: Merged
Merged at revision: 13
Proposed branch: lp:~om26er/ubuntu-autopilot-tests/test_fixtures
Merge into: lp:ubuntu-autopilot-tests/ubuntu-experience-tests
Diff against target: 189 lines (+115/-14)
6 files modified
ubuntu_integration_tests/__init__.py (+15/-6)
ubuntu_integration_tests/fixture_setup.py (+1/-1)
ubuntu_integration_tests/helpers.py (+1/-1)
ubuntu_integration_tests/tests/__init__.py (+12/-3)
ubuntu_integration_tests/tests/test_fixture_setup.py (+73/-0)
ubuntu_integration_tests/tests/test_osd_dialer_integration.py (+13/-3)
To merge this branch: bzr merge lp:~om26er/ubuntu-autopilot-tests/test_fixtures
Reviewer Review Type Date Requested Status
Chris Gagnon (community) Needs Fixing
PS Jenkins bot continuous-integration Approve
Ubuntu Testcase Admins Pending
Review via email: mp+207055@code.launchpad.net

Commit message

added tests for the environment fixtures

To post a comment you must log in.
14. By Omer Akram

argh, forgot to add the new tests file

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Chris Gagnon (chris.gagnon) wrote :

please add docstrings describing the goal of the tests, otherwise lgtm

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ubuntu_integration_tests/__init__.py'
--- ubuntu_integration_tests/__init__.py 2014-02-06 19:37:41 +0000
+++ ubuntu_integration_tests/__init__.py 2014-02-18 22:19:55 +0000
@@ -1,8 +1,17 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2# Copyright 2014 Canonical2#
3#3# Copyright 2014 Canonical Ltd.
4# This file is part of <>.4#
5#5# This file is part of ubuntu-integration-tests.
6# dialer-app is free software: you can redistribute it and/or modify it6#
7# under the terms of the GNU General Public License version 3, as published7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License version 3, as published
8# by the Free Software Foundation.9# by the Free Software Foundation.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program. If not, see <http://www.gnu.org/licenses/>
918
=== modified file 'ubuntu_integration_tests/fixture_setup.py'
--- ubuntu_integration_tests/fixture_setup.py 2014-02-08 14:47:33 +0000
+++ ubuntu_integration_tests/fixture_setup.py 2014-02-18 22:19:55 +0000
@@ -15,7 +15,7 @@
15# GNU General Public License for more details.15# GNU General Public License for more details.
16#16#
17# You should have received a copy of the GNU General Public License17# You should have received a copy of the GNU General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.18# along with this program. If not, see <http://www.gnu.org/licenses/>
1919
20"""Set up and clean up fixtures for the Inter-app integration tests."""20"""Set up and clean up fixtures for the Inter-app integration tests."""
2121
2222
=== modified file 'ubuntu_integration_tests/helpers.py'
--- ubuntu_integration_tests/helpers.py 2014-02-08 14:47:33 +0000
+++ ubuntu_integration_tests/helpers.py 2014-02-18 22:19:55 +0000
@@ -15,7 +15,7 @@
15# GNU General Public License for more details.15# GNU General Public License for more details.
16#16#
17# You should have received a copy of the GNU General Public License17# You should have received a copy of the GNU General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.18# along with this program. If not, see <http://www.gnu.org/licenses/>
1919
20"""Helper functions to make writing Inter-app integration tests easier."""20"""Helper functions to make writing Inter-app integration tests easier."""
2121
2222
=== modified file 'ubuntu_integration_tests/tests/__init__.py'
--- ubuntu_integration_tests/tests/__init__.py 2014-02-08 14:47:33 +0000
+++ ubuntu_integration_tests/tests/__init__.py 2014-02-18 22:19:55 +0000
@@ -1,12 +1,21 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2# Copyright 2014 Canonical2#
3# Copyright 2014 Canonical Ltd.
3# Author: Omer Akram <omer.akram@canonical.com>4# Author: Omer Akram <omer.akram@canonical.com>
4#5#
5# This file is part of ubuntu-integration-tests.6# This file is part of ubuntu-integration-tests.
6#7#
7# dialer-app is free software: you can redistribute it and/or modify it8# This program is free software; you can redistribute it and/or modify
8# under the terms of the GNU General Public License version 3, as published9# it under the terms of the GNU General Public License version 3, as published
9# by the Free Software Foundation.10# by the Free Software Foundation.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>
1019
11from autopilot.input import Touch, Pointer20from autopilot.input import Touch, Pointer
12from autopilot.testcase import AutopilotTestCase21from autopilot.testcase import AutopilotTestCase
1322
=== added file 'ubuntu_integration_tests/tests/test_fixture_setup.py'
--- ubuntu_integration_tests/tests/test_fixture_setup.py 1970-01-01 00:00:00 +0000
+++ ubuntu_integration_tests/tests/test_fixture_setup.py 2014-02-18 22:19:55 +0000
@@ -0,0 +1,73 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2#
3# Copyright 2014 Canonical Ltd.
4# Author: Omer Akram <omer.akram@canonical.com>
5#
6# This file is part of ubuntu-integration-tests.
7#
8# This program is free software; you can redistribute it and/or modify
9# it under the terms of the GNU General Public License version 3, as published
10# by the Free Software Foundation.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>
19
20import subprocess
21
22import testtools
23
24from ubuntu_integration_tests import fixture_setup
25
26
27class TestabilityEnvironmentTestCase(testtools.TestCase):
28
29 def setUp(self):
30 super(TestabilityEnvironmentTestCase, self).setUp()
31 old_var = self.get_environment_variable()
32 self.addCleanup(self.set_environment_variable, old_var)
33 self.set_environment_variable('dummy')
34
35 def get_environment_variable(self):
36 try:
37 return subprocess.check_output(
38 [
39 'initctl',
40 'get-env',
41 'QT_LOAD_TESTABILITY'
42 ]
43 ).strip()
44 except:
45 return None
46
47 def set_environment_variable(self, value):
48 subprocess.call(
49 [
50 '/sbin/initctl',
51 'set-env',
52 'QT_LOAD_TESTABILITY={}'.format(value)
53 ]
54 )
55
56 def test_fixture_must_setup_testability_environment(self):
57 fixture = fixture_setup.TestabilityEnvironment()
58 self.useFixture(fixture)
59
60 self.assertEquals('1', self.get_environment_variable())
61
62 def test_fixture_must_cleanup_testability_environment(self):
63 fixture = fixture_setup.TestabilityEnvironment()
64
65 def inner_test():
66 class TestWithFakeApplication(testtools.TestCase):
67 def test_it(self):
68 self.useFixture(fixture)
69 return TestWithFakeApplication('test_it')
70
71 inner_test().run()
72
73 self.assertIsNone(self.get_environment_variable())
074
=== modified file 'ubuntu_integration_tests/tests/test_osd_dialer_integration.py'
--- ubuntu_integration_tests/tests/test_osd_dialer_integration.py 2014-02-08 14:47:33 +0000
+++ ubuntu_integration_tests/tests/test_osd_dialer_integration.py 2014-02-18 22:19:55 +0000
@@ -1,11 +1,21 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2# Copyright 2014 Canonical2#
3# Copyright 2014 Canonical Ltd.
3# Author: Omer Akram <omer.akram@canonical.com>4# Author: Omer Akram <omer.akram@canonical.com>
4#5#
5# This file is part of ubuntu-integration-tests.6# This file is part of ubuntu-integration-tests.
6# dialer-app is free software: you can redistribute it and/or modify it7#
7# under the terms of the GNU General Public License version 3, as published8# This program is free software; you can redistribute it and/or modify
9# it under the terms of the GNU General Public License version 3, as published
8# by the Free Software Foundation.10# by the Free Software Foundation.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>
919
10from autopilot.matchers import Eventually20from autopilot.matchers import Eventually
11from autopilot.platform import model21from autopilot.platform import model

Subscribers

People subscribed via source and target branches