Skip to content

Commit

Permalink
fix: improve a test
Browse files Browse the repository at this point in the history
  • Loading branch information
juancarlospaco committed Dec 11, 2024
1 parent 3bb41fc commit 9780ea2
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions tests/test_qdrant.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,24 +66,21 @@ def test_qdrant_migrate_bad_url(
cli_runner: CliRunner,
) -> None:

with warnings.catch_warnings():
warnings.simplefilter("ignore")
with pytest.raises(Exception) as url_checker:
result = cli_runner.invoke(
app,
[
"qdrant",
"migrate",
qdrant_collection_name,
"", # Bad HTTP URL as intended.
"", # no API key needed in :memory: mode
postgres_connection_string,
],
)
raise result.exception

with pytest.raises(Exception) as url_checker:
result = cli_runner.invoke(
app,
[
"qdrant",
"migrate",
qdrant_collection_name,
"", # Bad HTTP URL as intended.
"", # no API key needed in :memory: mode
postgres_connection_string,
],
)
raise result.exception

assert "qdrant_url must be a valid HTTP URL string" in str(url_checker.value)
assert "qdrant_url must be a valid HTTP URL string" in str(url_checker.value)


def test_is_http_url():
Expand Down

0 comments on commit 9780ea2

Please sign in to comment.