forked from CastXML/CastXML-python-distributions
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_distribution.py
More file actions
29 lines (19 loc) · 819 Bytes
/
test_distribution.py
File metadata and controls
29 lines (19 loc) · 819 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import os
import pytest
from path import Path
DIST_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '../dist'))
def _check_castxml_install(virtualenv, tmpdir):
expected_version = "0.3.6"
for executable_name in ["castxml"]:
output = virtualenv.run(
"%s --version" % executable_name, capture=True).splitlines()[0]
assert output == "%s version %s" % (executable_name, expected_version)
@pytest.mark.skipif(not Path(DIST_DIR).exists(), reason="dist directory does not exist")
def test_wheel(virtualenv, tmpdir):
wheels = Path(DIST_DIR).files(match="*.whl")
if not wheels:
pytest.skip("no wheel available")
assert len(wheels) == 1
print(wheels)
virtualenv.run("pip install %s" % wheels[0])
_check_castxml_install(virtualenv, tmpdir)