diff options
| author | Steve Martinelli <stevemar@ca.ibm.com> | 2014-11-12 16:11:37 -0500 |
|---|---|---|
| committer | Dean Troyer <dtroyer@gmail.com> | 2014-11-15 16:29:08 -0600 |
| commit | 126b2c543617866e9e1ea45ef9c5770ce5f5dda9 (patch) | |
| tree | f7b23f32a12d8bf81ff7e441322efb8242082e10 /functional/tests | |
| parent | c55fdb6f6d1fc356ee03cf21fdf3d5b99418c921 (diff) | |
| download | python-openstackclient-126b2c543617866e9e1ea45ef9c5770ce5f5dda9.tar.gz | |
Add an API example base and functional test base
Add examples/common.py, which is a basic common setup that mimics OSC's
configuration options and logging without the rest of the CLI.
Also add the functional test tooling for examples to prevent bit rot.
Co-Authored-By: Dean Troyer <dtroyer@gmail.com>
Change-Id: Ie92b675eafd93482ddc9a8ce0b0588e23ed50c35
Diffstat (limited to 'functional/tests')
| -rw-r--r-- | functional/tests/test_examples.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/functional/tests/test_examples.py b/functional/tests/test_examples.py new file mode 100644 index 00000000..fdaa26b8 --- /dev/null +++ b/functional/tests/test_examples.py @@ -0,0 +1,22 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +from functional.common import test + + +class ExampleTests(test.TestCase): + """Functional tests for running examples.""" + + def test_common(self): + # NOTE(stevemar): If an examples has a non-zero return + # code, then execute will raise an error by default. + test.execute('python', test.EXAMPLE_DIR + '/common.py --debug') |
