Merge lp:~canonical-platform-qa/selenium-simple-test/fix1289990-update_sst-remote_count into lp:selenium-simple-test

Proposed by Leo Arias
Status: Work in progress
Proposed branch: lp:~canonical-platform-qa/selenium-simple-test/fix1289990-update_sst-remote_count
Merge into: lp:selenium-simple-test
Diff against target: 46 lines (+42/-0)
1 file modified
src/sst/tests/test_remote_script.py (+42/-0)
To merge this branch: bzr merge lp:~canonical-platform-qa/selenium-simple-test/fix1289990-update_sst-remote_count
Reviewer Review Type Date Requested Status
Alexander Kamyanskiy (community) Approve
Canonical ISD QA Team Pending
Review via email: mp+242429@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Alexander Kamyanskiy (kamyanskiy) wrote :

looks nice Leo !

review: Approve

Unmerged revisions

440. By Leo Arias

Added a test that exposes bug 1289990.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'src/sst/tests/test_remote_script.py'
2--- src/sst/tests/test_remote_script.py 1970-01-01 00:00:00 +0000
3+++ src/sst/tests/test_remote_script.py 2014-11-20 21:49:57 +0000
4@@ -0,0 +1,42 @@
5+#
6+# Copyright (c) 2014 Canonical Ltd.
7+#
8+# This file is part of: SST (selenium-simple-test)
9+# https://launchpad.net/selenium-simple-test
10+#
11+# Licensed under the Apache License, Version 2.0 (the "License");
12+# you may not use this file except in compliance with the License.
13+# You may obtain a copy of the License at
14+#
15+# http://www.apache.org/licenses/LICENSE-2.0
16+#
17+# Unless required by applicable law or agreed to in writing, software
18+# distributed under the License is distributed on an "AS IS" BASIS,
19+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20+# See the License for the specific language governing permissions and
21+# limitations under the License.
22+
23+import cStringIO
24+
25+import mock
26+import testtools
27+
28+from sst import tests
29+from sst.scripts import remote
30+
31+
32+class RemoteScriptCommandsTestCase(testtools.TestCase):
33+
34+ @mock.patch('sys.stdout', new_callable=cStringIO.StringIO)
35+ def test_run_remote_with_collect_only_must_print_tests(self, mock_out):
36+ # This is also a regression tests for bug http://pad.lv/1289990
37+ tests.set_cwd_to_tmp(self)
38+ tests.write_tree_from_desc('''dir: tests
39+file: tests/test_foo.py
40+pass
41+''')
42+ args = ['dummy', '-d', 'tests', '--collect-only']
43+ with mock.patch('sys.argv', args):
44+ remote.main()
45+
46+ self.assertEqual('tests.test_foo\n', mock_out.getvalue())

Subscribers

People subscribed via source and target branches