def test_multiple_manifests_found() -> None: with patch("dfetch.manifest.manifest.find_file") as find_file_mock: find_file_mock.return_value = [DEFAULT_MANIFEST_NAME, "manifest2.yaml"] with pytest.raises(RuntimeError): find_manifest()
def test_multiple_manifests_found() -> None: with patch("dfetch.manifest.manifest.find_file") as find_file_mock: find_file_mock.return_value = [DEFAULT_MANIFEST_NAME, "manifest2.yaml"] assert os.path.realpath(DEFAULT_MANIFEST_NAME) == find_manifest()
def test_single_manifest_found() -> None: with patch("dfetch.manifest.manifest.find_file") as find_file_mock: find_file_mock.return_value = [DEFAULT_MANIFEST_NAME] assert os.path.join(os.getcwd(), DEFAULT_MANIFEST_NAME) == find_manifest()
def __call__(self, args: argparse.Namespace) -> None: """Perform the validation.""" del args # unused manifest_path = find_manifest() validate(manifest_path) manifest_path = os.path.relpath(manifest_path, os.getcwd()) logger.print_info_line(manifest_path, "valid")
def test_no_manifests_found() -> None: with patch("dfetch.manifest.manifest.find_file"): with pytest.raises(RuntimeError): find_manifest()