diff options
| author | Justin Shepherd <jshepher@rackspace.com> | 2011-08-03 09:32:24 -0500 |
|---|---|---|
| committer | Justin Shepherd <jshepher@rackspace.com> | 2011-08-03 09:32:24 -0500 |
| commit | d543b9914506b39defbf94ebc63eb95f0d58a8cd (patch) | |
| tree | 106faf9dd7e8ab7a9920b36592708d13459ab6cc | |
| parent | 836c394def93a8589bcb7387862390b24b8fdab8 (diff) | |
| download | nova-d543b9914506b39defbf94ebc63eb95f0d58a8cd.tar.gz nova-d543b9914506b39defbf94ebc63eb95f0d58a8cd.tar.xz nova-d543b9914506b39defbf94ebc63eb95f0d58a8cd.zip | |
Removed dependancy on os.getenv. Test cases now raise Exception if they are not properly skipped.
| -rw-r--r-- | nova/tests/test_skip_examples.py | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/nova/tests/test_skip_examples.py b/nova/tests/test_skip_examples.py index b7979d34b..e41cd848d 100644 --- a/nova/tests/test_skip_examples.py +++ b/nova/tests/test_skip_examples.py @@ -16,22 +16,18 @@ # License for the specific language governing permissions and limitations # under the License. -import os - from nova import test class ExampleSkipTestCase(test.TestCase): - @test.skip_test("testing skipping") + @test.skip_test("Example usage of @test.skip_test()") def test_skip_test(self): - x = 1 + raise Exception("skip_test failed to work properly.") - @test.skip_if(os.getenv("USER"), - "Skiping -- Environment variable USER exists") + @test.skip_if(True, "Example usage of @test.skip_if()") def test_skip_if_env_user_exists(self): - x = 1 + raise Exception("skip_if failed to work properly.") - @test.skip_unless(os.getenv("FOO"), - "Skipping -- Environment variable FOO does not exist") + @test.skip_unless(False, "Example usage of @test.skip_unless()") def test_skip_unless_env_foo_exists(self): - x = 1 + raise Exception("skip_unless failed to work properly.") |
