Commit c95ff061 authored by Stavros Sachtouris's avatar Stavros Sachtouris
Browse files

Pick "networking" as the name of the new client

Refs: #4546
parent 058ee9a8
......@@ -32,10 +32,10 @@
# or implied, of GRNET S.A.
from kamaki.clients import ClientError
from kamaki.clients.network.rest_api import NetworkRestClient
from kamaki.clients.networking.rest_api import NetworkingRestClient
class NetworkClient(NetworkRestClient):
class NetworkingClient(NetworkingRestClient):
"""OpenStack Network API 2.0 client"""
def list_networks(self):
......
......@@ -36,7 +36,7 @@ from kamaki.clients.utils import path4url
from json import dumps
class NetworkRestClient(Client):
class NetworkingRestClient(Client):
def networks_get(self, network_id=None, **kwargs):
if network_id:
......
......@@ -36,16 +36,16 @@ from unittest import TestCase
from itertools import product
from json import dumps
from kamaki.clients import ClientError, network
from kamaki.clients import networking
class NetworkRestClient(TestCase):
class NetworkingRestClient(TestCase):
"""Set up a ComputesRest thorough test"""
def setUp(self):
self.url = 'http://network.example.com'
self.url = 'http://networking.example.com'
self.token = 'n2tw0rk70k3n'
self.client = network.NetworkRestClient(self.url, self.token)
self.client = networking.NetworkingRestClient(self.url, self.token)
def tearDown(self):
del self.client
......@@ -265,19 +265,19 @@ class FakeObject(object):
json = None
class NetworkClient(TestCase):
class NetworkingClient(TestCase):
"""Set up a ComputesRest thorough test"""
def setUp(self):
self.url = 'http://network.example.com'
self.token = 'n2tw0rk70k3n'
self.client = network.NetworkClient(self.url, self.token)
self.client = networking.NetworkingClient(self.url, self.token)
def tearDown(self):
del self.client
@patch(
'kamaki.clients.network.NetworkClient.networks_get',
'kamaki.clients.networking.NetworkingClient.networks_get',
return_value=FakeObject())
def test_list_networks(self, networks_get):
FakeObject.json = dict(networks='ret val')
......@@ -285,7 +285,7 @@ class NetworkClient(TestCase):
networks_get.assert_called_once_with(success=200)
@patch(
'kamaki.clients.network.NetworkClient.networks_post',
'kamaki.clients.networking.NetworkingClient.networks_post',
return_value=FakeObject())
def test_create_network(self, networks_post):
FakeObject.json = dict(network='ret val')
......@@ -312,11 +312,11 @@ if __name__ == '__main__':
from sys import argv
from kamaki.clients.test import runTestCase
not_found = True
if not argv[1:] or argv[1] == 'NetworkClient':
if not argv[1:] or argv[1] == 'NetworkingClient':
not_found = False
runTestCase(NetworkClient, 'Network Client', argv[2:])
if not argv[1:] or argv[1] == 'NetworkRest':
runTestCase(NetworkingClient, 'Networking Client', argv[2:])
if not argv[1:] or argv[1] == 'NetworkingRest':
not_found = False
runTestCase(NetworkRestClient, 'NetworkRest Client', argv[2:])
runTestCase(NetworkingRestClient, 'NetworkingRest Client', argv[2:])
if not_found:
print('TestCase %s not found' % argv[1])
......@@ -41,7 +41,8 @@ from random import randint
from kamaki.clients.utils.test import Utils
from kamaki.clients.astakos.test import AstakosClient
from kamaki.clients.compute.test import ComputeClient, ComputeRestClient
from kamaki.clients.network.test import NetworkClient, NetworkRestClient
from kamaki.clients.networking.test import (
NetworkingClient, NetworkingRestClient)
from kamaki.clients.cyclades.test import CycladesClient
from kamaki.clients.cyclades.test import CycladesRestClient
from kamaki.clients.image.test import ImageClient
......
......@@ -76,6 +76,7 @@ setup(
'kamaki.clients.astakos',
'kamaki.clients.compute',
'kamaki.clients.cyclades',
'kamaki.clients.networking'
],
classifiers=[
'Operating System :: OS Independent',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment