Skip to content
Snippets Groups Projects

Improve dependency check

Merged Samuel GAIST requested to merge improve_dependency_check into master
2 files
+ 118
60
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -55,13 +55,15 @@ def call(*args, **kwargs):
use_prefix = kwargs.get("prefix", prefix)
arguments = ["--prefix", use_prefix, "--cache", tmp_prefix] + list(args)
verbose = kwargs.get("verbose", False)
if not verbose:
arguments.insert(0, "--test-mode")
runner = CliRunner()
with runner.isolated_filesystem():
result = runner.invoke(
main_cli.main,
["--test-mode", "--prefix", use_prefix, "--cache", tmp_prefix] + list(args),
catch_exceptions=False,
)
result = runner.invoke(main_cli.main, arguments, catch_exceptions=False)
return result.exit_code, result.output
@@ -97,6 +99,19 @@ def test_cache_view():
nose.tools.eq_(ex_code, 0, out)
@slow
def test_cache_remove():
nose.tools.assert_not_equal(len(os.listdir(tmp_prefix)), 0)
ex_code, out = call("cache", "info", verbose=True)
nose.tools.eq_(ex_code, 0, out)
entry = out.split("\n")[0]
entry = entry[6:]
ex_code, out = call("cache", "remove", "--no-inputs", entry)
nose.tools.eq_(ex_code, 0, out)
nose.tools.assert_true(out.startswith("About to delete:"))
nose.tools.assert_true(out.endswith("Done\n"))
@slow
def test_cache_clear():
nose.tools.assert_not_equal(len(os.listdir(tmp_prefix)), 0)
Loading