Revision bc826292 test/ganeti.rapi.client_unittest.py
b/test/ganeti.rapi.client_unittest.py | ||
---|---|---|
34 | 34 |
from ganeti import query |
35 | 35 |
from ganeti import objects |
36 | 36 |
from ganeti import rapi |
37 |
from ganeti import errors |
|
37 | 38 |
|
38 | 39 |
import ganeti.rapi.testutils |
39 | 40 |
from ganeti.rapi import connector |
... | ... | |
136 | 137 |
self.assertEqual(client._NODE_EVAC_RES1, rlib2._NODE_EVAC_RES1) |
137 | 138 |
self.assertEqual(client.NODE_EVAC_RES1, rlib2._NODE_EVAC_RES1) |
138 | 139 |
|
140 |
def testErrors(self): |
|
141 |
self.assertEqual(client.ECODE_ALL, errors.ECODE_ALL) |
|
142 |
|
|
143 |
# Make sure all error codes are in both RAPI client and errors module |
|
144 |
for name in filter(lambda s: (s.startswith("ECODE_") and s != "ECODE_ALL"), |
|
145 |
dir(client)): |
|
146 |
value = getattr(client, name) |
|
147 |
self.assertEqual(value, getattr(errors, name)) |
|
148 |
self.assertTrue(value in client.ECODE_ALL) |
|
149 |
self.assertTrue(value in errors.ECODE_ALL) |
|
150 |
|
|
139 | 151 |
|
140 | 152 |
class RapiMockTest(unittest.TestCase): |
141 | 153 |
def test404(self): |
Also available in: Unified diff