Pick "networking" as the name of the new client
authorStavros Sachtouris <saxtouri@admin.grnet.gr>
Mon, 4 Nov 2013 09:48:04 +0000 (11:48 +0200)
committerStavros Sachtouris <saxtouri@admin.grnet.gr>
Mon, 4 Nov 2013 09:48:04 +0000 (11:48 +0200)
Refs: #4546

kamaki/clients/networking/__init__.py [moved from kamaki/clients/network/__init__.py with 94% similarity]
kamaki/clients/networking/rest_api.py [moved from kamaki/clients/network/rest_api.py with 99% similarity]
kamaki/clients/networking/test.py [moved from kamaki/clients/network/test.py with 94% similarity]
kamaki/clients/test.py
setup.py

similarity index 94%
rename from kamaki/clients/network/__init__.py
rename to kamaki/clients/networking/__init__.py
index 804d46f..6c39d0e 100644 (file)
 # 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):
similarity index 99%
rename from kamaki/clients/network/rest_api.py
rename to kamaki/clients/networking/rest_api.py
index 0d33c58..821d5eb 100644 (file)
@@ -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:
similarity index 94%
rename from kamaki/clients/network/test.py
rename to kamaki/clients/networking/test.py
index 4a43a96..21b6725 100644 (file)
@@ -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])
index 0ad4236..13d8e21 100644 (file)
@@ -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
index 6398889..e9f9292 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -76,6 +76,7 @@ setup(
         'kamaki.clients.astakos',
         'kamaki.clients.compute',
         'kamaki.clients.cyclades',
+        'kamaki.clients.networking'
     ],
     classifiers=[
         'Operating System :: OS Independent',