No prefix to curl commands in debug log output.
This commit is contained in:
parent
2e12167dac
commit
582b9fe178
6 changed files with 11 additions and 11 deletions
|
@ -52,7 +52,7 @@ class BaseSource(ABC):
|
|||
|
||||
def log_curl(self, response):
|
||||
curl = curlify.to_curl(response.request, compressed=True)
|
||||
logging.debug(f"Request to {self.id()}: {curl}")
|
||||
logging.debug(curl)
|
||||
return response
|
||||
|
||||
def format_symbols(self) -> str:
|
||||
|
|
|
@ -305,7 +305,7 @@ def test_fetch_stock_requests_logged(src, type, search_ok, ibm_ok, caplog):
|
|||
src.fetch(Series("IBM", "", type, "2021-01-04", "2021-01-08"))
|
||||
logged_requests = 0
|
||||
for r in caplog.records:
|
||||
if r.levelname == "DEBUG" and " curl " in r.message:
|
||||
if r.levelname == "DEBUG" and "curl " in r.message:
|
||||
logged_requests += 1
|
||||
assert logged_requests == 2
|
||||
|
||||
|
@ -428,7 +428,7 @@ def test_fetch_physical_requests_logged(src, type, physical_list_ok, euraud_ok,
|
|||
src.fetch(Series("EUR", "AUD", type, "2021-01-04", "2021-01-08"))
|
||||
logged_requests = 0
|
||||
for r in caplog.records:
|
||||
if r.levelname == "DEBUG" and " curl " in r.message:
|
||||
if r.levelname == "DEBUG" and "curl " in r.message:
|
||||
logged_requests += 1
|
||||
assert logged_requests == 2
|
||||
|
||||
|
@ -527,7 +527,7 @@ def test_fetch_digital_requests_logged(
|
|||
src.fetch(Series("BTC", "AUD", type, "2021-01-04", "2021-01-08"))
|
||||
logged_requests = 0
|
||||
for r in caplog.records:
|
||||
if r.levelname == "DEBUG" and " curl " in r.message:
|
||||
if r.levelname == "DEBUG" and "curl " in r.message:
|
||||
logged_requests += 1
|
||||
assert logged_requests == 3
|
||||
|
||||
|
|
|
@ -114,7 +114,7 @@ def test_symbols_requests_logged(src, currencies_response_ok, caplog):
|
|||
with caplog.at_level(logging.DEBUG):
|
||||
src.symbols()
|
||||
assert any(
|
||||
["DEBUG" == r.levelname and " curl " in r.message for r in caplog.records]
|
||||
["DEBUG" == r.levelname and "curl " in r.message for r in caplog.records]
|
||||
)
|
||||
|
||||
|
||||
|
@ -165,7 +165,7 @@ def test_fetch_requests_logged(src, type, recent_response_ok, caplog):
|
|||
with caplog.at_level(logging.DEBUG):
|
||||
src.fetch(Series("BTC", "AUD", type, "2021-01-01", "2021-01-07"))
|
||||
assert any(
|
||||
["DEBUG" == r.levelname and " curl " in r.message for r in caplog.records]
|
||||
["DEBUG" == r.levelname and "curl " in r.message for r in caplog.records]
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -132,7 +132,7 @@ def test_symbols_requests_logged(src, crypto_ok, fiat_ok, caplog):
|
|||
src.symbols()
|
||||
logged_requests = 0
|
||||
for r in caplog.records:
|
||||
if r.levelname == "DEBUG" and " curl " in r.message:
|
||||
if r.levelname == "DEBUG" and "curl " in r.message:
|
||||
logged_requests += 1
|
||||
assert logged_requests == 2
|
||||
|
||||
|
@ -258,7 +258,7 @@ def test_fetch_requests_logged(src, type, recent_sym_sym_ok, caplog):
|
|||
with caplog.at_level(logging.DEBUG):
|
||||
src.fetch(Series("BTC", "AUD", type, "2021-01-01", "2021-01-07"))
|
||||
assert any(
|
||||
["DEBUG" == r.levelname and " curl " in r.message for r in caplog.records]
|
||||
["DEBUG" == r.levelname and "curl " in r.message for r in caplog.records]
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ def test_symbols_requests_logged_for(src, response_ok, caplog):
|
|||
with caplog.at_level(logging.DEBUG):
|
||||
src.symbols()
|
||||
assert any(
|
||||
["DEBUG" == r.levelname and " curl " in r.message for r in caplog.records]
|
||||
["DEBUG" == r.levelname and "curl " in r.message for r in caplog.records]
|
||||
)
|
||||
|
||||
|
||||
|
@ -134,7 +134,7 @@ def test_fetch_requests_logged(src, response_ok, caplog):
|
|||
with caplog.at_level(logging.DEBUG):
|
||||
src.fetch(Series("EUR", "AUD", type, "2021-01-04", "2021-01-08"))
|
||||
assert any(
|
||||
["DEBUG" == r.levelname and " curl " in r.message for r in caplog.records]
|
||||
["DEBUG" == r.levelname and "curl " in r.message for r in caplog.records]
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@ def test_fetch_requests_logged(src, type, spark_ok, recent_ok, caplog):
|
|||
src.fetch(Series("TSLA", "", type, "2021-01-04", "2021-01-08"))
|
||||
logged_requests = 0
|
||||
for r in caplog.records:
|
||||
if r.levelname == "DEBUG" and " curl " in r.message:
|
||||
if r.levelname == "DEBUG" and "curl " in r.message:
|
||||
logged_requests += 1
|
||||
assert logged_requests == 2
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue