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)
| 141 | |
| 142 | |
| 143 | def 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( |
nothing calls this directly
no test coverage detected