Skip to content

Commit

Permalink
fix test and remove proto code
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Lock <[email protected]>
  • Loading branch information
Sambigeara committed Jan 15, 2024
1 parent 3021b20 commit be6faa4
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 43 deletions.
9 changes: 0 additions & 9 deletions proto/buf.gen.yaml

This file was deleted.

10 changes: 0 additions & 10 deletions proto/buf.yaml

This file was deleted.

14 changes: 0 additions & 14 deletions proto/generate_protos.sh

This file was deleted.

2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def start_container(client_type, listener, tmp_path_factory, with_admin=False):

host = container.http_host() if client_type == "http" else container.grpc_host()
else:
# (07-23 saml) macOS+docker does not play nice when it comes to sharing UDS across the host and container. I've not figured out how to work around
# (jul-23 saml) macOS+docker does not play nice when it comes to sharing UDS across the host and container. I've not figured out how to work around
# this yet so I tend to comment out `uds` in the fixture params above and rely on CI to test the full suite.
sock_dir = tmp_path_factory.mktemp("socket")

Expand Down
8 changes: 2 additions & 6 deletions tests/grpc/test_grpc_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,9 @@ def test_check_resources_empty_resources(
):
with pytest.raises(
grpc.RpcError,
match="invalid CheckResourcesRequest.Resources: value must contain at least 1 item\\(s\\)",
) as e:
cerbos_grpc_client.check_resources(principal_john, [])
err = e.value
assert err.code().value[0] == 3
assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT

def test_plan_resources(
self,
Expand Down Expand Up @@ -194,11 +192,9 @@ async def test_check_resources_empty_resources(
):
with pytest.raises(
grpc.aio.AioRpcError,
match="invalid CheckResourcesRequest.Resources: value must contain at least 1 item\\(s\\)",
) as e:
await cerbos_async_grpc_client.check_resources(principal_john, [])
err = e.value
assert err.code().value[0] == 3
assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT

async def test_plan_resources(
self,
Expand Down
4 changes: 1 addition & 3 deletions tests/http/test_http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
# SPDX-License-Identifier: Apache-2.0

import json
from unittest.mock import Mock, patch
from unittest.mock import patch

import anyio
import pytest
from tenacity import RetryError

from cerbos.sdk.client import *
from cerbos.sdk.model import *
Expand Down

0 comments on commit be6faa4

Please sign in to comment.