test\integration\test_wily.py
-- -- --- --- --- --- --- --- ------- ------- ------- | import pathlib
-- -- --- --- --- --- --- --- ------- ------- ------- |
-- -- --- --- --- --- --- --- ------- ------- ------- | from click.testing import CliRunner
-- -- --- --- --- --- --- --- ------- ------- ------- |
-- -- --- --- --- --- --- --- ------- ------- ------- | import wily.__main__ as main
-- -- --- --- --- --- --- --- ------- ------- ------- |
-- -- --- --- --- --- --- --- ------- ------- ------- |
-- 01 001 002 001 002 003 003 0004.75 0002.38 0000.50 | def test_list_metrics(builddir):
-- -- 001 002 001 002 003 003 0004.75 0002.38 0000.50 | """
-- -- 001 002 001 002 003 003 0004.75 0002.38 0000.50 | Test that list-metrics works with a build
-- -- 001 002 001 002 003 003 0004.75 0002.38 0000.50 | """
-- -- 001 002 001 002 003 003 0004.75 0002.38 0000.50 | runner = CliRunner()
-- -- 001 002 001 002 003 003 0004.75 0002.38 0000.50 | result = runner.invoke(main.cli, ["--path", builddir, "list-metrics"])
-- -- 001 002 001 002 003 003 0004.75 0002.38 0000.50 | assert result.exit_code == 0, result.stdout
-- -- --- --- --- --- --- --- ------- ------- ------- |
-- -- --- --- --- --- --- --- ------- ------- ------- |
-- 01 003 005 003 005 008 008 0024.00 0036.00 0001.50 | def test_clean(builddir):
-- -- 003 005 003 005 008 008 0024.00 0036.00 0001.50 | """Test the clean feature"""
-- -- 003 005 003 005 008 008 0024.00 0036.00 0001.50 | runner = CliRunner()
-- -- 003 005 003 005 008 008 0024.00 0036.00 0001.50 | result = runner.invoke(main.cli, ["--path", builddir, "clean", "--yes"])
-- -- 003 005 003 005 008 008 0024.00 0036.00 0001.50 | assert result.exit_code == 0, result.stdout
-- -- 003 005 003 005 008 008 0024.00 0036.00 0001.50 | cache_path = pathlib.Path(builddir) / ".wily"
-- -- 003 005 003 005 008 008 0024.00 0036.00 0001.50 | assert not cache_path.exists()
-- -- --- --- --- --- --- --- ------- ------- ------- |
-- -- --- --- --- --- --- --- ------- ------- ------- |
-- 01 001 002 001 002 003 003 0004.75 0002.38 0000.50 | def test_clean_no_cache(tmpdir):
-- -- 001 002 001 002 003 003 0004.75 0002.38 0000.50 | runner = CliRunner()
-- -- 001 002 001 002 003 003 0004.75 0002.38 0000.50 | result = runner.invoke(main.cli, ["--path", tmpdir, "clean"])
-- -- 001 002 001 002 003 003 0004.75 0002.38 0000.50 | assert result.exit_code == 0, result.stdout
-- -- --- --- --- --- --- --- ------- ------- ------- |
-- -- --- --- --- --- --- --- ------- ------- ------- |
-- 01 001 002 001 002 003 003 0004.75 0002.38 0000.50 | def test_list_metrics_no_cache(tmpdir):
-- -- 001 002 001 002 003 003 0004.75 0002.38 0000.50 | runner = CliRunner()
-- -- --- --- --- --- --- --- ------- ------- ------- | result = runner.invoke(main.cli, ["--path", tmpdir, "list-metrics"])
-- -- --- --- --- --- --- --- ------- ------- ------- | assert result.exit_code == 1, result.stdout