From a229b5bb850fce2655eaa5d22b251a416fc10580 Mon Sep 17 00:00:00 2001 From: Justin Shepherd Date: Thu, 4 Aug 2011 09:29:43 -0500 Subject: [PATCH] Added in tests that verify tests are skipped appropriately. --- nova/tests/test_skip_examples.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/nova/tests/test_skip_examples.py b/nova/tests/test_skip_examples.py index 0ae3576f..033f1ea2 100644 --- a/nova/tests/test_skip_examples.py +++ b/nova/tests/test_skip_examples.py @@ -20,6 +20,8 @@ from nova import test class ExampleSkipTestCase(test.TestCase): + test_counter = 0 + @test.skip_test("Example usage of @test.skip_test()") def test_skip_test_example(self): self.fail("skip_test failed to work properly.") @@ -31,3 +33,15 @@ class ExampleSkipTestCase(test.TestCase): @test.skip_unless(False, "Example usage of @test.skip_unless()") def test_skip_unless_example(self): self.fail("skip_unless failed to work properly.") + + @test.skip_if(False, "This test case should never be skipped.") + def test_001_increase_test_counter(self): + ExampleSkipTestCase.test_counter += 1 + + @test.skip_unless(True, "This test case should never be skipped.") + def test_002_increase_test_counter(self): + ExampleSkipTestCase.test_counter += 1 + + def test_003_verify_test_counter(self): + self.assertEquals(ExampleSkipTestCase.test_counter, 2, + "Tests were not skipped appropriately")