-
Notifications
You must be signed in to change notification settings - Fork 11
/
test_options_full.py
35 lines (28 loc) · 918 Bytes
/
test_options_full.py
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
30
31
32
33
34
35
from .conftest import URANIUM_SOURCE_ROOT
from uranium.scripts import execute_script
def test_options(tmpdir):
""" if uranium fails on an exception, it should return a proper exit code. """
ubuild = """
def main(build):
print("main")
print(build.options.args)
def test(build):
print("test")
print(build.options.args)
""".strip()
# we need to create a virtualenv
tmpdir.join("ubuild.py").write(ubuild)
_, out, err = execute_script(
"uranium_standalone", "--uranium-dir", URANIUM_SOURCE_ROOT,
"main", "foo",
cwd=tmpdir.strpath
)
assert "main" in out.decode("UTF-8")
assert "foo" in out.decode("UTF-8")
_, out, err = execute_script(
"uranium_standalone", "--uranium-dir", URANIUM_SOURCE_ROOT,
"main", "foo",
cwd=tmpdir.strpath
)
assert "test" in out.decode("UTF-8")
assert "foo" in out.decode("UTF-8")