fixes
continuous-integration/drone/pr Build is failing Details

This commit is contained in:
Andrew Wang 2021-08-27 23:01:35 -04:00
parent d6dbfd5d3f
commit 562c6aca96
3 changed files with 13 additions and 14 deletions

View File

@ -1,10 +1,9 @@
from flask import Blueprint, request
from flask import Blueprint
from zope import component
from functools import wraps
from ceod.api.utils import authz_restrict_to_staff, authz_restrict_to_syscom, \
user_is_in_group, requires_authentication_no_realm, \
create_streaming_response, development_only
from ceod.api.utils import authz_restrict_to_syscom, user_is_in_group, requires_authentication_no_realm, \
development_only
from ceo_common.errors import UserNotFoundError, DatabaseConnectionError, DatabasePermissionError, \
InvalidUsernameError, UserAlreadyExistsError
from ceo_common.interfaces import ILDAPService, IDatabaseService

View File

@ -22,7 +22,7 @@ def test_api_create_mysql_db(cfg, client, g_admin_ctx, create_user_result):
assert status == 409
# normal user cannot create db for others
status, data = client.post(f"/api/mysql/someone_else", json={}, principal=uid)
status, data = client.post("/api/mysql/someone_else", json={}, principal=uid)
assert status == 403
# cannot create db for user not in ldap
@ -85,9 +85,9 @@ def test_api_passwd_reset_mysql(cfg, client, g_admin_ctx, create_user_result):
old_passwd = data['password']
con = connect(
host=cfg.get('ceod_database_host'),
user=uid,
password=old_passwd,
host=cfg.get('ceod_database_host'),
user=uid,
password=old_passwd,
)
con.close()
@ -104,7 +104,7 @@ def test_api_passwd_reset_mysql(cfg, client, g_admin_ctx, create_user_result):
assert status == 403
# cannot password reset a user that does not have a database
status, data = client.post(f"/api/mysql/someone_else/pwreset", json={})
status, data = client.post("/api/mysql/someone_else/pwreset", json={})
assert status == 404
con = connect(

View File

@ -21,7 +21,7 @@ def test_api_create_psql_db(cfg, client, g_admin_ctx, create_user_result):
assert status == 409
# normal user cannot create db for others
status, data = client.post(f"/api/postgresql/someone_else", json={}, principal=uid)
status, data = client.post("/api/postgresql/someone_else", json={}, principal=uid)
assert status == 403
# cannot create db for user not in ldap
@ -84,9 +84,9 @@ def test_api_passwd_reset_psql(cfg, client, g_admin_ctx, create_user_result):
old_passwd = data['password']
con = connect(
host=cfg.get('ceod_database_host'),
user=uid,
password=old_passwd,
host=cfg.get('ceod_database_host'),
user=uid,
password=old_passwd,
)
con.close()
@ -103,7 +103,7 @@ def test_api_passwd_reset_psql(cfg, client, g_admin_ctx, create_user_result):
assert status == 403
# cannot password reset a user that does not have a database
status, data = client.post(f"/api/postgresql/someone_else/pwreset", json={})
status, data = client.post("/api/postgresql/someone_else/pwreset", json={})
assert status == 404
con = connect(