~landscape/zope3/ztk-1.1.3

« back to all changes in this revision

Viewing changes to src/zope/testing/testrunner-ex/samplelayers.py

  • Committer: Thomas Hervé
  • Date: 2009-09-21 06:45:37 UTC
  • mfrom: (7.1.2 newer-zope-testing)
  • Revision ID: thomas@canonical.com-20090921064537-zcfyuv32hxj9eah0
Merge newer-zope-testing [a=sidnei] [f=429702] [r=therve,free.ekayanaka]

Update zope.testing to 3.8.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
##############################################################################
2
 
#
3
 
# Copyright (c) 2004 Zope Corporation and Contributors.
4
 
# All Rights Reserved.
5
 
#
6
 
# This software is subject to the provisions of the Zope Public License,
7
 
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
8
 
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
9
 
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
10
 
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
11
 
# FOR A PARTICULAR PURPOSE.
12
 
#
13
 
##############################################################################
14
 
"""Sample test layers
15
 
 
16
 
$Id: samplelayers.py 30501 2005-05-25 17:40:56Z tim_one $
17
 
"""
18
 
 
19
 
layer = '0' # Internal to samples. Not part of layer API
20
 
layerx = '0'
21
 
 
22
 
class Layer1:
23
 
    # Internal to samples. Not part of layer API:
24
 
    layer = '1'
25
 
    base = '0'
26
 
    layerx = '0'
27
 
 
28
 
    def setUp(self):
29
 
        global layer
30
 
        if layer != self.base:
31
 
            raise ValueError("Bad layer, %s, for %s." % (layer, self))
32
 
        layer = self.layer
33
 
    setUp = classmethod(setUp)
34
 
 
35
 
    def tearDown(self):
36
 
        global layer
37
 
        if layer != self.layer:
38
 
            raise ValueError("Bad layer, %s, for %s." % (layer, self))
39
 
        layer = self.base
40
 
    tearDown = classmethod(tearDown)
41
 
 
42
 
class Layerx:
43
 
    layerx = '1' # Internal to samples. Not part of layer API
44
 
    basex = '0'
45
 
 
46
 
    def setUp(self):
47
 
        global layerx
48
 
        if layerx != self.basex:
49
 
            raise ValueError("Bad layerx, %s, for %s." % (layerx, self))
50
 
        layerx = self.layerx
51
 
    setUp = classmethod(setUp)
52
 
 
53
 
    def tearDown(self):
54
 
        global layerx
55
 
        if layerx != self.layerx:
56
 
            raise ValueError("Bad layerx, %s, for %s." % (layerx, self))
57
 
        layerx = self.basex
58
 
    tearDown = classmethod(tearDown)
59
 
 
60
 
class Layer11(Layer1):
61
 
    layer = '11' # Internal to samples. Not part of layer API
62
 
    base  = '1'  # Internal to samples. Not part of layer API
63
 
 
64
 
class Layer12(Layer1):
65
 
    layer = '12' # Internal to samples. Not part of layer API
66
 
    base  = '1'  # Internal to samples. Not part of layer API
67
 
 
68
 
class Layer111(Layerx, Layer11):
69
 
    layer = '111' # Internal to samples. Not part of layer API
70
 
    base  = '11'  # Internal to samples. Not part of layer API
71
 
    layerx = '2' # Internal to samples. Not part of layer API
72
 
    basex = '1'
73
 
 
74
 
    def setUp(self):
75
 
        global layer
76
 
        if layer != self.base:
77
 
            raise ValueError("Bad layer, %s, for %s." % (layer, self))
78
 
        layer = self.layer
79
 
        global layerx
80
 
        if layerx != self.basex:
81
 
            raise ValueError("Bad layerx, %s, for %s." % (layerx, self))
82
 
        layerx = self.layerx
83
 
    setUp = classmethod(setUp)
84
 
 
85
 
    def tearDown(self):
86
 
        global layer
87
 
        if layer != self.layer:
88
 
            raise ValueError("Bad layer, %s, for %s." % (layer, self))
89
 
        layer = self.base
90
 
        global layerx
91
 
        if layerx != self.layerx:
92
 
            raise ValueError("Bad layerx, %s, for %s." % (layerx, self))
93
 
        layerx = self.basex
94
 
    tearDown = classmethod(tearDown)
95
 
 
96
 
class Layer121(Layer12):
97
 
    layer = '121' # Internal to samples. Not part of layer API
98
 
    base  = '12'  # Internal to samples. Not part of layer API
99
 
 
100
 
class Layer112(Layerx, Layer11):
101
 
    layer = '112' # Internal to samples. Not part of layer API
102
 
    base  = '11'  # Internal to samples. Not part of layer API
103
 
    layerx = '2' # Internal to samples. Not part of layer API
104
 
    basex = '1'
105
 
 
106
 
    def setUp(self):
107
 
        global layer
108
 
        if layer != self.base:
109
 
            raise ValueError("Bad layer, %s, for %s." % (layer, self))
110
 
        layer = self.layer
111
 
        global layerx
112
 
        if layerx != self.basex:
113
 
            raise ValueError("Bad layerx, %s, for %s." % (layerx, self))
114
 
        layerx = self.layerx
115
 
    setUp = classmethod(setUp)
116
 
 
117
 
    def tearDown(self):
118
 
        global layer
119
 
        if layer != self.layer:
120
 
            raise ValueError("Bad layer, %s, for %s." % (layer, self))
121
 
        layer = self.base
122
 
        global layerx
123
 
        if layerx != self.layerx:
124
 
            raise ValueError("Bad layerx, %s, for %s." % (layerx, self))
125
 
        layerx = self.basex
126
 
    tearDown = classmethod(tearDown)
127
 
 
128
 
class Layer122(Layer12):
129
 
    layer = '122' # Internal to samples. Not part of layer API
130
 
    base  = '12'  # Internal to samples. Not part of layer API