1
# vim: tabstop=4 shiftwidth=4 softtabstop=4
3
# Copyright 2010 United States Government as represented by the
4
# Administrator of the National Aeronautics and Space Administration.
7
# Licensed under the Apache License, Version 2.0 (the "License"); you may
8
# not use this file except in compliance with the License. You may obtain
9
# a copy of the License at
11
# http://www.apache.org/licenses/LICENSE-2.0
13
# Unless required by applicable law or agreed to in writing, software
14
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16
# License for the specific language governing permissions and limitations
22
class ExampleSkipTestCase(test.TestCase):
25
@test.skip_test("Example usage of @test.skip_test()")
26
def test_skip_test_example(self):
27
self.fail("skip_test failed to work properly.")
29
@test.skip_if(True, "Example usage of @test.skip_if()")
30
def test_skip_if_example(self):
31
self.fail("skip_if failed to work properly.")
33
@test.skip_unless(False, "Example usage of @test.skip_unless()")
34
def test_skip_unless_example(self):
35
self.fail("skip_unless failed to work properly.")
37
@test.skip_if(False, "This test case should never be skipped.")
38
def test_001_increase_test_counter(self):
39
ExampleSkipTestCase.test_counter += 1
41
@test.skip_unless(True, "This test case should never be skipped.")
42
def test_002_increase_test_counter(self):
43
ExampleSkipTestCase.test_counter += 1
45
def test_003_verify_test_counter(self):
46
self.assertEquals(ExampleSkipTestCase.test_counter, 2,
47
"Tests were not skipped appropriately")