Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-pylib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-pylib
Commits
50a24b3a
Unverified
Commit
50a24b3a
authored
6 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
STY: autopep8
parent
e0f8e7c2
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/caosdb/common/administration.py
+3
-3
3 additions, 3 deletions
src/caosdb/common/administration.py
src/caosdb/connection/connection.py
+4
-4
4 additions, 4 deletions
src/caosdb/connection/connection.py
unittests/test_administraction.py
+2
-0
2 additions, 0 deletions
unittests/test_administraction.py
with
9 additions
and
7 deletions
src/caosdb/common/administration.py
+
3
−
3
View file @
50a24b3a
...
@@ -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.
...
...
This diff is collapsed.
Click to expand it.
src/caosdb/connection/connection.py
+
4
−
4
View file @
50a24b3a
...
@@ -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.
...
...
This diff is collapsed.
Click to expand it.
unittests/test_administraction.py
+
2
−
0
View file @
50a24b3a
...
@@ -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
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment