Skip to content

Commit

Permalink
Docstrings formatted according to pep257
Browse files Browse the repository at this point in the history
Bug #1020184

quantum/tests/*

Change-Id: I5c31a70e80c7fd448b92b43d34341301533b59ba
  • Loading branch information
Sergey Skripnick committed Apr 30, 2013
1 parent 58d13eb commit 13fbf22
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 102 deletions.
3 changes: 1 addition & 2 deletions quantum/tests/base.py
Expand Up @@ -60,8 +60,7 @@ def setUp(self):
self.stubs.Set(exception, '_FATAL_EXCEPTION_FORMAT_ERRORS', True)

def config(self, **kw):
"""
Override some configuration values.
"""Override some configuration values.
The keyword arguments are the names of configuration options to
override and their values.
Expand Down
12 changes: 3 additions & 9 deletions quantum/tests/unit/cisco/test_nexus_plugin.py
Expand Up @@ -36,9 +36,7 @@
class TestCiscoNexusPlugin(base.BaseTestCase):

def setUp(self):
"""
Set up function
"""
"""Set up function."""
super(TestCiscoNexusPlugin, self).setUp()
self.tenant_id = "test_tenant_cisco1"
self.net_name = "test_network_cisco1"
Expand Down Expand Up @@ -84,9 +82,7 @@ def new_nexus_init(self):
self.addCleanup(self.patch_obj.stop)

def test_create_networks(self):
"""
Tests creation of two new Virtual Networks.
"""
"""Tests creation of two new Virtual Networks."""
tenant_id = self.tenant_id
net_name = self.net_name
net_id = self.net_id
Expand Down Expand Up @@ -117,9 +113,7 @@ def test_create_networks(self):
self.assertEqual(new_net_dict[const.NET_VLAN_ID], self.second_vlan_id)

def test_nexus_delete_port(self):
"""
Test deletion of a vlan.
"""
"""Test deletion of a vlan."""
self._cisco_nexus_plugin.create_network(
self.tenant_id, self.net_name, self.net_id, self.vlan_name,
self.vlan_id, self._hostname, INSTANCE)
Expand Down
5 changes: 3 additions & 2 deletions quantum/tests/unit/extension_stubs.py
Expand Up @@ -48,9 +48,10 @@ def __init__(self, supported_extensions=[]):


class ExtensionExpectingPluginInterface(StubExtension):
"""
"""Expect plugin to implement all methods in StubPluginInterface.
This extension expects plugin to implement all the methods defined
in StubPluginInterface
in StubPluginInterface.
"""

def get_plugin_interface(self):
Expand Down
3 changes: 2 additions & 1 deletion quantum/tests/unit/hyperv/test_hyperv_quantum_agent.py
Expand Up @@ -72,7 +72,8 @@ def test_treat_devices_added_returns_true_for_missing_device(self):
self.assertTrue(self.agent._treat_devices_added([{}]))

def mock_treat_devices_added(self, details, func_name):
"""
"""Mock treat devices added.
:param details: the details to return for the device
:param func_name: the function that should be called
:returns: whether the named function was called
Expand Down
3 changes: 2 additions & 1 deletion quantum/tests/unit/nicira/fake_nvpapiclient.py
Expand Up @@ -291,7 +291,8 @@ def populate_field(field_name):
return new_data

def _get_resource_type(self, path):
"""
"""Get resource type.
Identifies resource type and relevant uuids in the uri
/ws.v1/lswitch/xxx
Expand Down
6 changes: 3 additions & 3 deletions quantum/tests/unit/openvswitch/test_ovs_lib.py
Expand Up @@ -23,8 +23,8 @@


class OVS_Lib_Test(base.BaseTestCase):
"""
A test suite to excercise the OVS libraries shared by Quantum agents.
"""A test suite to excercise the OVS libraries shared by Quantum agents.
Note: these tests do not actually execute ovs-* utilities, and thus
can run on any system. That does, however, limit their scope.
"""
Expand All @@ -41,7 +41,7 @@ def setUp(self):
self.addCleanup(self.mox.UnsetStubs)

def test_vifport(self):
"""create and stringify vif port, confirm no exceptions."""
"""Create and stringify vif port, confirm no exceptions."""
self.mox.ReplayAll()

pname = "vif1.0"
Expand Down
2 changes: 1 addition & 1 deletion quantum/tests/unit/openvswitch/test_ovs_quantum_agent.py
Expand Up @@ -112,7 +112,7 @@ def test_treat_devices_added_returns_true_for_missing_device(self):
self.assertTrue(self.agent.treat_devices_added([{}]))

def _mock_treat_devices_added(self, details, port, func_name):
"""
"""Mock treat devices added.
:param details: the details to return for the device
:param port: the port that get_vif_port_by_id should return
Expand Down
23 changes: 10 additions & 13 deletions quantum/tests/unit/test_extensions.py
Expand Up @@ -426,7 +426,8 @@ class ExtensionManagerTest(base.BaseTestCase):
def test_invalid_extensions_are_not_registered(self):

class InvalidExtension(object):
"""
"""Invalid extension.
This Extension doesn't implement extension methods :
get_name, get_description, get_namespace and get_updated
"""
Expand Down Expand Up @@ -458,8 +459,8 @@ def test_unsupported_extensions_are_not_loaded(self):

def test_extensions_are_not_loaded_for_plugins_unaware_of_extensions(self):
class ExtensionUnawarePlugin(object):
"""
This plugin does not implement supports_extension method.
"""This plugin does not implement supports_extension method.
Extensions will not be loaded when this plugin is used.
"""
pass
Expand All @@ -473,9 +474,7 @@ class ExtensionUnawarePlugin(object):
def test_extensions_not_loaded_for_plugin_without_expected_interface(self):

class PluginWithoutExpectedIface(object):
"""
Plugin does not implement get_foo method as expected by extension
"""
"""Does not implement get_foo method as expected by extension."""
supported_extension_aliases = ["supported_extension"]

plugin_info = {constants.CORE: PluginWithoutExpectedIface()}
Expand All @@ -488,9 +487,7 @@ class PluginWithoutExpectedIface(object):
def test_extensions_are_loaded_for_plugin_with_expected_interface(self):

class PluginWithExpectedInterface(object):
"""
This Plugin implements get_foo method as expected by extension
"""
"""Implements get_foo method as expected by extension."""
supported_extension_aliases = ["supported_extension"]

def get_foo(self, bar=None):
Expand All @@ -505,8 +502,8 @@ def get_foo(self, bar=None):

def test_extensions_expecting_quantum_plugin_interface_are_loaded(self):
class ExtensionForQuamtumPluginInterface(ext_stubs.StubExtension):
"""
This Extension does not implement get_plugin_interface method.
"""This Extension does not implement get_plugin_interface method.
This will work with any plugin implementing QuantumPluginBase
"""
pass
Expand All @@ -519,8 +516,8 @@ class ExtensionForQuamtumPluginInterface(ext_stubs.StubExtension):

def test_extensions_without_need_for__plugin_interface_are_loaded(self):
class ExtensionWithNoNeedForPluginInterface(ext_stubs.StubExtension):
"""
This Extension does not need any plugin interface.
"""This Extension does not need any plugin interface.
This will work with any plugin implementing QuantumPluginBase
"""
def get_plugin_interface(self):
Expand Down

0 comments on commit 13fbf22

Please sign in to comment.