Skip to content
Snippets Groups Projects
Unverified Commit 50a24b3a authored by Timm Fitschen's avatar Timm Fitschen
Browse files

STY: autopep8

parent e0f8e7c2
Branches
Tags
No related merge requests found
...@@ -32,7 +32,7 @@ from caosdb.common.utils import xml2str ...@@ -32,7 +32,7 @@ from caosdb.common.utils import xml2str
def set_server_property(key, value): def set_server_property(key, value):
"""set_server_property """set_server_property.
Set a server property. Set a server property.
...@@ -55,7 +55,7 @@ def set_server_property(key, value): ...@@ -55,7 +55,7 @@ def set_server_property(key, value):
def get_server_properties(): def get_server_properties():
"""get_server_properties """get_server_properties.
Get all server properties as a dict. Get all server properties as a dict.
...@@ -74,7 +74,7 @@ def get_server_properties(): ...@@ -74,7 +74,7 @@ def get_server_properties():
def get_server_property(key): def get_server_property(key):
"""get_server_property """get_server_property.
Get a server property. Get a server property.
......
...@@ -72,7 +72,7 @@ class _WrappedHTTPResponse(CaosDBHTTPResponse): ...@@ -72,7 +72,7 @@ class _WrappedHTTPResponse(CaosDBHTTPResponse):
class _DefaultCaosDBServerConnection(CaosDBServerConnection): class _DefaultCaosDBServerConnection(CaosDBServerConnection):
"""_DefaultCaosDBServerConnection """_DefaultCaosDBServerConnection.
Methods Methods
------- -------
...@@ -87,7 +87,7 @@ class _DefaultCaosDBServerConnection(CaosDBServerConnection): ...@@ -87,7 +87,7 @@ class _DefaultCaosDBServerConnection(CaosDBServerConnection):
self._base_path = None self._base_path = None
def request(self, method, path, headers=None, body=None, **kwargs): def request(self, method, path, headers=None, body=None, **kwargs):
"""request """request.
Send a HTTP request to the server. Send a HTTP request to the server.
...@@ -121,7 +121,7 @@ class _DefaultCaosDBServerConnection(CaosDBServerConnection): ...@@ -121,7 +121,7 @@ class _DefaultCaosDBServerConnection(CaosDBServerConnection):
return _WrappedHTTPResponse(self._http_con.getresponse()) return _WrappedHTTPResponse(self._http_con.getresponse())
def configure(self, **config): def configure(self, **config):
"""configure """configure.
Configure the http connection. Configure the http connection.
...@@ -196,7 +196,7 @@ _DEFAULT_CONF = {"password_method": "plain", "implementation": ...@@ -196,7 +196,7 @@ _DEFAULT_CONF = {"password_method": "plain", "implementation":
def _get_authenticator(**config): def _get_authenticator(**config):
"""_get_authenticator """_get_authenticator.
Import and configure the password_method. Import and configure the password_method.
......
...@@ -49,6 +49,7 @@ def test_get_server_property_success(): ...@@ -49,6 +49,7 @@ def test_get_server_property_success():
lambda **kwargs: MockUpResponse(200, {}, properties)) lambda **kwargs: MockUpResponse(200, {}, properties))
assert "TEST_VAL" == administration.get_server_property("TEST_PROP") assert "TEST_VAL" == administration.get_server_property("TEST_PROP")
def test_get_server_property_key_error(): def test_get_server_property_key_error():
properties = "<Properties><TEST_PROP>TEST_VAL</TEST_PROP></Properties>" properties = "<Properties><TEST_PROP>TEST_VAL</TEST_PROP></Properties>"
get_connection()._delegate_connection.resources.append( get_connection()._delegate_connection.resources.append(
...@@ -56,6 +57,7 @@ def test_get_server_property_key_error(): ...@@ -56,6 +57,7 @@ def test_get_server_property_key_error():
with raises(KeyError) as e: with raises(KeyError) as e:
assert administration.get_server_property("BLA") assert administration.get_server_property("BLA")
def test_set_server_property(): def test_set_server_property():
def check_form(**kwargs): def check_form(**kwargs):
assert kwargs["path"] == "_server_properties" assert kwargs["path"] == "_server_properties"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment