Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: add timeout config test #33

Merged
merged 1 commit into from
Jan 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions dvc_http/tests/test_config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ssl

import pytest
from dvc.fs import HTTPFileSystem
from fsspec.asyn import get_loop as get_fsspec_loop
from fsspec.asyn import sync
Expand Down Expand Up @@ -94,3 +95,18 @@ def test_http_method():

fs = HTTPFileSystem(**config, method="POST")
assert fs.upload_method == "POST"


@pytest.mark.parametrize(
"kwarg,value",
(
("connect_timeout", 42),
("read_timeout", 42),
),
)
def test_timeout_options(kwarg, value):
url = "https://remote.dvc.org/get-started"
config = {"url": url, kwarg: value}
fs = HTTPFileSystem(**config)

assert fs.fs_args["client_kwargs"][kwarg] == value