mirror of
https://github.com/cssgunc/compass.git
synced 2025-04-09 22:00:18 -04:00
Compare commits
3 Commits
abb53cdb6e
...
a4940bfd1c
Author | SHA1 | Date | |
---|---|---|---|
|
a4940bfd1c | ||
|
3f8989968e | ||
|
cb54c9829d |
|
@ -47,9 +47,6 @@ RUN mkdir -p /etc/apt/keyrings \
|
|||
&& npm install -g npm@latest \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install Angular CLI Globally
|
||||
RUN npm install -g @angular/cli
|
||||
|
||||
# Use a non-root user per https://code.visualstudio.com/remote/advancedcontainers/add-nonroot-user
|
||||
ARG USERNAME=vscode
|
||||
ARG USER_UID=1000
|
||||
|
|
|
@ -155,6 +155,6 @@ class ResourceService:
|
|||
entities = self._session.scalars(query).all()
|
||||
|
||||
if not entities:
|
||||
raise ResourceNotFoundException(f"No resource found with matching slug: {search_string}")
|
||||
return []
|
||||
|
||||
return [entity.to_model() for entity in entities]
|
|
@ -106,14 +106,14 @@ def test_get_by_slug(resource_svc: ResourceService):
|
|||
def test_get_by_slug_not_found(resource_svc: ResourceService):
|
||||
""" Test getting a resource that does not exist """
|
||||
slug = "Not Found"
|
||||
with pytest.raises(ResourceNotFoundException):
|
||||
resources = resource_svc.get_by_slug(user_test_data.admin, slug)
|
||||
pytest.fail()
|
||||
resources = resource_svc.get_by_slug(user_test_data.admin, slug)
|
||||
assert len(resources) == 0
|
||||
assert resources == []
|
||||
|
||||
|
||||
def test_get_by_slug_no_permission(resource_svc: ResourceService):
|
||||
""" Test getting a resource the user does not have access to """
|
||||
slug = "Resource 2"
|
||||
with pytest.raises(ResourceNotFoundException):
|
||||
resources = resource_svc.get_by_slug(user_test_data.employee, slug)
|
||||
pytest.fail()
|
||||
resources = resource_svc.get_by_slug(user_test_data.employee, slug)
|
||||
assert len(resources) == 0
|
||||
assert resources == []
|
Loading…
Reference in New Issue
Block a user