Revision c3a5176f test/py/ganeti.rapi.baserlib_unittest.py
b/test/py/ganeti.rapi.baserlib_unittest.py | ||
---|---|---|
109 | 109 |
attrs = ["%s_OPCODE" % method, "%s_RENAME" % method, |
110 | 110 |
"Get%sOpInput" % method.capitalize()] |
111 | 111 |
assert attrs == dict((opattrs[0], list(opattrs[1:])) |
112 |
for opattrs in baserlib._OPCODE_ATTRS)[method]
|
|
112 |
for opattrs in baserlib.OPCODE_ATTRS)[method] |
|
113 | 113 |
return attrs |
114 | 114 |
|
115 | 115 |
def test(self): |
116 | 116 |
for method in baserlib._SUPPORTED_METHODS: |
117 | 117 |
# Empty handler |
118 | 118 |
obj = self._MakeClass(method, {})(None, None, None) |
119 |
for attr in itertools.chain(*baserlib._OPCODE_ATTRS):
|
|
119 |
for attr in itertools.chain(*baserlib.OPCODE_ATTRS): |
|
120 | 120 |
self.assertFalse(hasattr(obj, attr)) |
121 | 121 |
|
122 | 122 |
# Direct handler function |
... | ... | |
153 | 153 |
|
154 | 154 |
obj = _Empty(None, None, None) |
155 | 155 |
|
156 |
for attr in itertools.chain(*baserlib._OPCODE_ATTRS):
|
|
156 |
for attr in itertools.chain(*baserlib.OPCODE_ATTRS): |
|
157 | 157 |
self.assertFalse(hasattr(obj, attr)) |
158 | 158 |
|
159 | 159 |
|
Also available in: Unified diff