~ubuntu-branches/ubuntu/vivid/manila/vivid-proposed

« back to all changes in this revision

Viewing changes to manila/tests/test_skip_examples.py

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2015-01-15 11:55:33 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20150115115533-yshssd76s2uj3ybx
Tags: 2015.1~b1-0ubuntu1
* New upstream release:
  - d/control: Add new dependencies.
  - Install any new binaries and configuration to common package.
* d/watch: Update to use tarballs.openstack.org.
* d/control,compat: Bump debhelper compat level to 9.
* d/control: Bumped Standards-Version to 3.9.6, no changes.
* Systemd enablement:
  - d/rules,control: Enable use of dh-systemd and openstack-pkg-tools.
  - d/*.init.in: Write templates for generation of init, service and
    upstart configurations.
  - d/*.upstart: Drop in preference to above.
* d/*.logrotate: Move to single logrotate configuration in common package.
* d/rules: Ensure unit test suite failure fails package build.
* d/p/pep-0476.patch: Deal with SSL certification chain verification unit
  test failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
 
 
3
 
# Copyright 2010 United States Government as represented by the
4
 
# Administrator of the National Aeronautics and Space Administration.
5
 
# All Rights Reserved.
6
 
#
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
10
 
#
11
 
#         http://www.apache.org/licenses/LICENSE-2.0
12
 
#
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
17
 
#    under the License.
18
 
 
19
 
from manila import test
20
 
 
21
 
 
22
 
class ExampleSkipTestCase(test.TestCase):
23
 
    test_counter = 0
24
 
 
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.")
28
 
 
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.")
32
 
 
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.")
36
 
 
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
40
 
 
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
44
 
 
45
 
    def test_003_verify_test_counter(self):
46
 
        self.assertEquals(ExampleSkipTestCase.test_counter, 2,
47
 
                          "Tests were not skipped appropriately")