Skip to content

Commit

Permalink
fix: linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sagivoululumigo committed Dec 4, 2023
1 parent dba9e5d commit ba3bd5e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/test/integration/fastapi/app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def invoke_requests(request: dict):

@app.get("/call-external")
def call_external():
response = requests.get('http://example.com')
response = requests.get("http://example.com")
return {"status_code": response.status_code}


Expand Down
27 changes: 14 additions & 13 deletions src/test/integration/fastapi/tests/test_fastapi.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import unittest
from parameterized import parameterized
import pytest

from test.test_utils.spans_parser import SpansContainer

Expand Down Expand Up @@ -193,18 +192,20 @@ def test_large_span_attribute_size_default_max_size(self):
200,
)

@parameterized.expand([
# regex matches, so we shouldn't see the client span sending a request to that endpoint
(r".*example\.com.*", 3, 0),
# regex doesn't match, so we should see the client span sending a request to that endpoint
(r".*this-will-not-match-anything.*", 4, 1)
])
def test_skip_outbound_http_request(self, regex: str, expected_span_count: int, expected_client_span_count: int):
with FastApiApp("app:app",
APP_PORT,
env={
"LUMIGO_AUTO_FILTER_HTTP_ENDPOINTS_REGEX": regex
}):
@parameterized.expand(
[
# regex matches, so we shouldn't see the client span sending a request to that endpoint
(r".*example\.com.*", 3, 0),
# regex doesn't match, so we should see the client span sending a request to that endpoint
(r".*this-will-not-match-anything.*", 4, 1),
]
)
def test_skip_outbound_http_request(
self, regex: str, expected_span_count: int, expected_client_span_count: int
):
with FastApiApp(
"app:app", APP_PORT, env={"LUMIGO_AUTO_FILTER_HTTP_ENDPOINTS_REGEX": regex}
):
response = requests.get(f"http://localhost:{APP_PORT}/call-external")
response.raise_for_status()

Expand Down

0 comments on commit ba3bd5e

Please sign in to comment.