mirror of
https://github.com/mvt-project/mvt.git
synced 2026-07-28 23:28:48 +02:00
31 lines
947 B
Python
31 lines
947 B
Python
# Mobile Verification Toolkit (MVT)
|
|
# Copyright (c) 2021-2023 The MVT Authors.
|
|
# Use of this software is governed by the MVT License 1.1 that can be found at
|
|
# https://license.mvt.re/1.1/
|
|
|
|
import os
|
|
|
|
from click.testing import CliRunner
|
|
|
|
from mvt.android.cli import check_bugreport
|
|
|
|
from .utils import get_artifact_folder
|
|
|
|
|
|
class TestCheckBugreportCommand:
|
|
def test_check(self):
|
|
runner = CliRunner()
|
|
path = os.path.join(get_artifact_folder(), "android_data/bugreport/")
|
|
result = runner.invoke(check_bugreport, [path])
|
|
assert result.exit_code == 0
|
|
|
|
def test_invalid_zip_reports_clean_error(self, tmp_path):
|
|
path = tmp_path / "invalid.zip"
|
|
path.write_bytes(b"not a zip archive")
|
|
|
|
result = CliRunner().invoke(check_bugreport, [str(path)])
|
|
|
|
assert result.exit_code == 1
|
|
assert "Invalid bugreport archive" in result.output
|
|
assert "Traceback" not in result.output
|