Skip to content

Commit

Permalink
remove test
Browse files Browse the repository at this point in the history
  • Loading branch information
hughhhh committed Aug 7, 2024
1 parent 9f320f9 commit cc096fe
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 63 deletions.
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions superset/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,8 @@ def _try_json_readsha(filepath: str, length: int) -> str | None:
# ex: http://localhost:8080/swagger/v1
FAB_API_SWAGGER_UI = True

FAB_ADD_SECURITY_API = True

# ----------------------------------------------------
# AUTHENTICATION CONFIG
# ----------------------------------------------------
Expand Down
65 changes: 2 additions & 63 deletions tests/integration_tests/security/api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def test_post_security_roles_gamma(self):
@with_config({"FAB_ADD_SECURITY_API": True})
def test_put_security_roles_gamma(self):
"""
Security API: <TODO>
Security API: Gamma shouldnt be able to update roles
"""
self.login(GAMMA_USERNAME)
response = self.client.put(
Expand All @@ -188,7 +188,7 @@ def test_put_security_roles_gamma(self):
@with_config({"FAB_ADD_SECURITY_API": True})
def test_delete_security_roles_gamma(self):
"""
Security API: <TODO>
Security API: Gamma shouldnt be able to delete roles
"""
self.login(GAMMA_USERNAME)
response = self.client.delete(
Expand All @@ -197,64 +197,3 @@ def test_delete_security_roles_gamma(self):
content_type="application/json",
)
self.assert403(response)


class TestSecurityPermissionsApi(SupersetTestCase):
uri = "api/v1/security/permission/" # noqa: F541

@with_config({"FAB_ADD_SECURITY_API": True})
def test_get_security_roles_admin(self):
"""
Security API: Admin should be able to create roles
"""
self.login(ADMIN_USERNAME)
response = self.client.get(self.uri)
self.assert200(response)

@with_config({"FAB_ADD_SECURITY_API": True})
def test_get_security_roles_gamma(self):
"""
Security API: Admin should be able to create roles
"""
self.login(GAMMA_USERNAME)
response = self.client.get(self.uri)
self.assert200(response)

@with_config({"FAB_ADD_SECURITY_API": True})
def test_post_security_roles_gamma(self):
"""
Security API: Gamma shouldnt be able to create roles
"""
self.login(GAMMA_USERNAME)
response = self.client.post(
self.uri,
data=json.dumps({"name": "new_role"}),
content_type="application/json",
)
self.assert403(response)

# @with_config({"FAB_ADD_SECURITY_API": True})
# def test_put_security_roles_gamma(self):
# """
# Security API: <TODO>
# """
# self.login(GAMMA_USERNAME)
# response = self.client.put(
# f"{self.uri}1",
# data=json.dumps({"name": "new_role"}),
# content_type="application/json",
# )
# self.assert403(response)

# @with_config({"FAB_ADD_SECURITY_API": True})
# def test_delete_security_roles_gamma(self):
# """
# Security API: <TODO>
# """
# self.login(GAMMA_USERNAME)
# response = self.client.delete(
# f"{self.uri}1",
# data=json.dumps({"name": "new_role"}),
# content_type="application/json",
# )
# self.assert403(response)

0 comments on commit cc096fe

Please sign in to comment.