From 615ad3de54507038d276eae50e7d46fb359c57c3 Mon Sep 17 00:00:00 2001 From: Ben Nemec <openstack@nemebean.com> Date: Thu, 15 Aug 2013 17:31:37 -0500 Subject: [PATCH] Create v3 tests directory Create a basic framework that inherits from v1_1 and can be overridden as necessary in extension commits bp v3-api Change-Id: I611451e50a9e553a18777fa48f32e368b919605e --- novaclient/tests/v3/__init__.py | 0 novaclient/tests/v3/fakes.py | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 novaclient/tests/v3/__init__.py create mode 100644 novaclient/tests/v3/fakes.py diff --git a/novaclient/tests/v3/__init__.py b/novaclient/tests/v3/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/novaclient/tests/v3/fakes.py b/novaclient/tests/v3/fakes.py new file mode 100644 index 000000000..8b7f4d2d5 --- /dev/null +++ b/novaclient/tests/v3/fakes.py @@ -0,0 +1,32 @@ +# Copyright (c) 2011 X.commerce, a business unit of eBay Inc. +# Copyright 2011 OpenStack Foundation +# Copyright 2013 IBM Corp. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from novaclient.v3 import client +from novaclient.tests import fakes +from novaclient.tests.v1_1 import fakes as fakes_v1_1 + + +class FakeClient(fakes.FakeClient, client.Client): + + def __init__(self, *args, **kwargs): + client.Client.__init__(self, 'username', 'password', + 'project_id', 'auth_url', + extensions=kwargs.get('extensions')) + self.client = FakeHTTPClient(**kwargs) + + +class FakeHTTPClient(fakes_v1_1.FakeHTTPClient): + pass