[PATCH 21/25] tests: Clean up 'test_xmlrpc'

Stephen Finucane stephen.finucane at intel.com
Fri Jun 24 07:53:42 AEST 2016


* Use underscore_case, rather than camelCase

Signed-off-by: Stephen Finucane <stephen.finucane at intel.com>
---
 patchwork/tests/test_xmlrpc.py |   27 ++++++++++++++-------------
 1 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/patchwork/tests/test_xmlrpc.py b/patchwork/tests/test_xmlrpc.py
index a5b69fb..e63e713 100644
--- a/patchwork/tests/test_xmlrpc.py
+++ b/patchwork/tests/test_xmlrpc.py
@@ -24,43 +24,44 @@ from django.core.urlresolvers import reverse
 from django.test import LiveServerTestCase
 from django.utils.six.moves import xmlrpc_client
 
-from patchwork.tests import utils
+from patchwork.tests.utils import create_patches
 
 
 @unittest.skipUnless(settings.ENABLE_XMLRPC,
                      'requires xmlrpc interface (use the ENABLE_XMLRPC '
                      'setting)')
 class XMLRPCTest(LiveServerTestCase):
+
     fixtures = ['default_states']
 
     def setUp(self):
-        self.url = (self.live_server_url + reverse('xmlrpc'))
+        self.url = self.live_server_url + reverse('xmlrpc')
         self.rpc = xmlrpc_client.Server(self.url)
 
-    def testGetRedirect(self):
+    def test_get_redirect(self):
         response = self.client.patch(self.url)
-        self.assertRedirects(response,
-                             reverse('help', kwargs={'path': 'pwclient/'}))
+        self.assertRedirects(
+            response, reverse('help', kwargs={'path': 'pwclient/'}))
 
-    def testListSingle(self):
-        patch_objs = utils.create_patches()
+    def test_list_single(self):
+        patch_objs = create_patches()
         patches = self.rpc.patch_list()
         self.assertEqual(len(patches), 1)
         self.assertEqual(patches[0]['id'], patch_objs[0].id)
 
-    def testListMultiple(self):
-        utils.create_patches(5)
+    def test_list_multiple(self):
+        create_patches(5)
         patches = self.rpc.patch_list()
         self.assertEqual(len(patches), 5)
 
-    def testListMaxCount(self):
-        patch_objs = utils.create_patches(5)
+    def test_list_max_count(self):
+        patch_objs = create_patches(5)
         patches = self.rpc.patch_list({'max_count': 2})
         self.assertEqual(len(patches), 2)
         self.assertEqual(patches[0]['id'], patch_objs[0].id)
 
-    def testListNegativeMaxCount(self):
-        patch_objs = utils.create_patches(5)
+    def test_list_negative_max_count(self):
+        patch_objs = create_patches(5)
         patches = self.rpc.patch_list({'max_count': -1})
         self.assertEqual(len(patches), 1)
         self.assertEqual(patches[0]['id'], patch_objs[-1].id)
-- 
1.7.4.1



More information about the Patchwork mailing list