diff options
Diffstat (limited to 'tests/frontend/buildcheckout.py')
-rw-r--r-- | tests/frontend/buildcheckout.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/frontend/buildcheckout.py b/tests/frontend/buildcheckout.py index 8c7e22a85..156fab990 100644 --- a/tests/frontend/buildcheckout.py +++ b/tests/frontend/buildcheckout.py @@ -2,6 +2,7 @@ import os import tarfile import hashlib import pytest +import subprocess from tests.testutils import cli, create_repo, ALL_REPO_KINDS, generate_junction from tests.testutils.site import IS_WINDOWS @@ -61,6 +62,35 @@ def test_build_checkout(datafiles, cli, strict, hardlinks): assert os.path.exists(filename) +@pytest.mark.datafiles(DATA_DIR + "_world") +def test_build_default_all(datafiles, cli): + project = os.path.join(datafiles.dirname, datafiles.basename) + result = cli.run(project=project, silent=True, args=['build']) + + result.assert_success() + target_dir = os.path.join(cli.directory, DATA_DIR + "_world", "elements") + output_dir = os.path.join(cli.directory, "logs", "test") + + expected = subprocess.Popen(('ls', target_dir), stdout=subprocess.PIPE) + expected = subprocess.check_output(("wc", "-w"), stdin=expected.stdout) + + results = subprocess.Popen(('ls', output_dir), stdout=subprocess.PIPE) + results = subprocess.check_output(("wc", "-w"), stdin=results.stdout) + + assert results == expected + + +@pytest.mark.datafiles(DATA_DIR + "_default") +def test_build_default(cli, datafiles): + project = os.path.join(datafiles.dirname, datafiles.basename) + result = cli.run(project=project, silent=True, args=['build']) + + result.assert_success() + results = cli.get_element_state(project, "target2.bst") + expected = "cached" + assert results == expected + + @pytest.mark.datafiles(DATA_DIR) @pytest.mark.parametrize("strict,hardlinks", [ ("non-strict", "hardlinks"), |