Skip to content
Snippets Groups Projects
Commit 2b4e6bfd authored by Florian Bruhin's avatar Florian Bruhin
Browse files

Finish tests

parent 4d728b71
No related branches found
No related tags found
No related merge requests found
[pytest]
addopts = --strict-markers --strict-config --cov --cov-report=html --cov-report=xml:cov.xml --cov-report=term
#--cov-fail-under=100
addopts = --strict-markers --strict-config --cov --cov-report=html --cov-report=xml:cov.xml --cov-report=term --cov-fail-under=100
xfail_strict = true
# pytest-golden
enable_assertion_pass_hook = true
......@@ -147,6 +147,30 @@ def test_wrong_location(
expected.check(result)
def test_wrong_location_force(
runner: Runner,
tmp_path: pathlib.Path,
httpx_mock: HTTPXMock,
golden: GoldenTestFixture,
) -> None:
nb_path = tmp_path / "nb.ipynb"
nb_path.touch()
golden = golden.open(GOLDEN_PATH / "simple.yml")
httpx_mock.add_response(
url="http://localhost:5000/testbook",
method="POST",
json=golden["input"],
)
result = runner.run("--force", nb_path)
assert "Refusing to submit file from unexpected location:" not in result.output
assert "Submission successful!" in result.output
assert result.exit_code == 0
@pytest.fixture
def nb_arg(tmp_path: pathlib.Path, monkeypatch: pytest.MonkeyPatch) -> pathlib.Path:
"""Set up a valid notebook at the proper location."""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment