Skip to content

Commit

Permalink
update download test to be platform based
Browse files Browse the repository at this point in the history
  • Loading branch information
mikealfare committed Apr 15, 2024
1 parent 20a635c commit 53f07b0
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions test/integration/bundle/test_download.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from pathlib import Path
import platform
from semantic_version import Version
import sys

Expand All @@ -21,9 +22,17 @@ def test_correct_version_of_psycopg2(test_version):
tmp_dir = Path(bundle_configuration.py_version_tmp_path)
assert tmp_dir.is_dir()
psycopg2_is_found = False
psycopg2_binary_is_found = False
for file in tmp_dir.iterdir():
if "psycopg2" in file.name:
psycopg2_is_found = True
assert "psycopg2-binary" not in file.name
assert "psycopg2_binary" not in file.name
assert psycopg2_is_found
if "psycopg2_binary" not in file.name:
psycopg2_is_found = True
else:
psycopg2_binary_is_found = True
if platform.system() == "Linux":
assert psycopg2_is_found and not psycopg2_binary_is_found
elif platform.system() == "Darwin":
assert psycopg2_binary_is_found and not psycopg2_is_found
else:
assert False, f"Unexpected platform: {platform.system()}"

0 comments on commit 53f07b0

Please sign in to comment.