MCPcopy Index your code
hub / github.com/SourceCode-AI/aura / test_non_existing

Function test_non_existing

tests/test_outputs.py:143–161  ·  view source on GitHub ↗

Test the behaviour if a non-existing location is passed to aura for scanning Aura should fail with exit code 1 Printing error message to stdout No traceback should be printed as it should be handled by cli instead of propagating to interpreter

(fixtures)

Source from the content-addressed store, hash-verified

141
142
143def test_non_existing(fixtures):
144 """
145 Test the behaviour if a non-existing location is passed to aura for scanning
146 Aura should fail with exit code 1
147 Printing error message to stdout
148 No traceback should be printed as it should be handled by cli instead of propagating to interpreter
149 """
150 pth = 'does_not_exists_on_earth.py'
151 cli = fixtures.get_cli_output(['scan', pth], check_exit_code=False)
152
153 assert (cli.exception is None) or (type(cli.exception) == SystemExit)
154 assert cli.exit_code == 1
155 # Check that stderr doesn't contain traceback information
156 # assert "Traceback" not in cli.stderr
157 # stderr should contain the error message
158 assert "Invalid location" in cli.stderr
159 # stdout should not contain any of these
160 assert "Traceback" not in cli.stdout
161 assert "Invalid location" not in cli.stdout
162
163
164@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 1

get_cli_outputMethod · 0.80

Tested by

no test coverage detected