test\integration\test_ipynb.py
-- -- --- --- --- --- --- --- ------- ------- ------- | import sys
-- -- --- --- --- --- --- --- ------- ------- ------- |
-- -- --- --- --- --- --- --- ------- ------- ------- | from click.testing import CliRunner
-- -- --- --- --- --- --- --- ------- ------- ------- |
-- -- --- --- --- --- --- --- ------- ------- ------- | import wily.__main__ as main
-- -- --- --- --- --- --- --- ------- ------- ------- |
-- -- --- --- --- --- --- --- ------- ------- ------- | _path = "src\\test.ipynb" if sys.platform == "win32" else "src/test.ipynb"
-- -- --- --- --- --- --- --- ------- ------- ------- |
-- -- --- --- --- --- --- --- ------- ------- ------- |
-- 01 002 004 002 004 006 006 0015.51 0015.51 0001.00 | def test_index_with_ipynb(ipynbbuilddir):
-- -- 002 004 002 004 006 006 0015.51 0015.51 0001.00 | """
-- -- 002 004 002 004 006 006 0015.51 0015.51 0001.00 | Test that index works with a build
-- -- 002 004 002 004 006 006 0015.51 0015.51 0001.00 | """
-- -- 002 004 002 004 006 006 0015.51 0015.51 0001.00 | runner = CliRunner()
-- -- 002 004 002 004 006 006 0015.51 0015.51 0001.00 | result = runner.invoke(main.cli, ["--path", ipynbbuilddir, "index"])
-- -- 002 004 002 004 006 006 0015.51 0015.51 0001.00 | assert result.stdout.count("An author") >= 3
-- -- 002 004 002 004 006 006 0015.51 0015.51 0001.00 | assert result.exit_code == 0, result.stdout
-- -- --- --- --- --- --- --- ------- ------- ------- |
-- -- --- --- --- --- --- --- ------- ------- ------- |
-- 01 003 008 005 010 011 015 0051.89 0097.30 0001.88 | def test_index_and_message_with_ipynb(ipynbbuilddir):
-- -- 003 008 005 010 011 015 0051.89 0097.30 0001.88 | """
-- -- 003 008 005 010 011 015 0051.89 0097.30 0001.88 | Test that index works with a build
-- -- 003 008 005 010 011 015 0051.89 0097.30 0001.88 | """
-- -- 003 008 005 010 011 015 0051.89 0097.30 0001.88 | runner = CliRunner()
-- -- 003 008 005 010 011 015 0051.89 0097.30 0001.88 | result = runner.invoke(main.cli, ["--path", ipynbbuilddir, "index", "--message"])
-- -- 003 008 005 010 011 015 0051.89 0097.30 0001.88 | assert result.stdout.count("An author") >= 3
-- -- 003 008 005 010 011 015 0051.89 0097.30 0001.88 | assert "empty notebook" in result.stdout
-- -- 003 008 005 010 011 015 0051.89 0097.30 0001.88 | assert "single cell" in result.stdout
-- -- 003 008 005 010 011 015 0051.89 0097.30 0001.88 | assert "second cell" in result.stdout
-- -- 003 008 005 010 011 015 0051.89 0097.30 0001.88 | assert result.exit_code == 0, result.stdout
-- -- --- --- --- --- --- --- ------- ------- ------- |
-- -- --- --- --- --- --- --- ------- ------- ------- |
-- 01 002 004 002 004 006 006 0015.51 0015.51 0001.00 | def test_report(ipynbbuilddir):
-- -- 002 004 002 004 006 006 0015.51 0015.51 0001.00 | """
-- -- --- --- --- --- --- --- ------- ------- ------- | Test that report works with a build and a specific metric
-- -- --- --- --- --- --- --- ------- ------- ------- | """
-- -- --- --- --- --- --- --- ------- ------- ------- | runner = CliRunner()
-- -- --- --- --- --- --- --- ------- ------- ------- | result = runner.invoke(
-- -- --- --- --- --- --- --- ------- ------- ------- | main.cli,
-- -- --- --- --- --- --- --- ------- ------- ------- | ["--path", ipynbbuilddir, "report", _path, "raw.multi", "maintainability.rank"],
-- -- --- --- --- --- --- --- ------- ------- ------- | )
-- -- --- --- --- --- --- --- ------- ------- ------- | assert result.exit_code == 0, result.stdout
-- -- --- --- --- --- --- --- ------- ------- ------- | assert "Not found" not in result.stdout