LGTM, thanks

On Tue, Feb 18, 2014 at 3:39 PM, Hrvoje Ribicic <[email protected]> wrote:

> The RAPI client is meant to be independent from the wider Ganeti
> codebase, but it still needs to use Ganeti constants. To enforce this,
> a unit test is used. This patch extends the unit test with error code
> messages, as these will be used in the commits to come.
>
> Signed-off-by: Hrvoje Ribicic <[email protected]>
> ---
>  test/py/ganeti.rapi.client_unittest.py | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/test/py/ganeti.rapi.client_unittest.py b/test/py/
> ganeti.rapi.client_unittest.py
> index 75833da..3f99791 100755
> --- a/test/py/ganeti.rapi.client_unittest.py
> +++ b/test/py/ganeti.rapi.client_unittest.py
> @@ -137,6 +137,18 @@ class TestConstants(unittest.TestCase):
>      self.assertEqual(client._NODE_EVAC_RES1, rlib2._NODE_EVAC_RES1)
>      self.assertEqual(client.NODE_EVAC_RES1, rlib2._NODE_EVAC_RES1)
>
> +    # Error codes
> +    self.assertEqual(client.ECODE_RESOLVER, errors.ECODE_RESOLVER)
> +    self.assertEqual(client.ECODE_NORES, errors.ECODE_NORES)
> +    self.assertEqual(client.ECODE_TEMP_NORES, errors.ECODE_TEMP_NORES)
> +    self.assertEqual(client.ECODE_INVAL, errors.ECODE_INVAL)
> +    self.assertEqual(client.ECODE_STATE, errors.ECODE_STATE)
> +    self.assertEqual(client.ECODE_NOENT, errors.ECODE_NOENT)
> +    self.assertEqual(client.ECODE_EXISTS, errors.ECODE_EXISTS)
> +    self.assertEqual(client.ECODE_NOTUNIQUE, errors.ECODE_NOTUNIQUE)
> +    self.assertEqual(client.ECODE_FAULT, errors.ECODE_FAULT)
> +    self.assertEqual(client.ECODE_ENVIRON, errors.ECODE_ENVIRON)
> +
>    def testErrors(self):
>      self.assertEqual(client.ECODE_ALL, errors.ECODE_ALL)
>
> --
> 1.9.0.rc1.175.g0b1dcb5
>
>

Reply via email to