コード例 #1
0
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()
コード例 #2
0
ファイル: test_manifest.py プロジェクト: jgeudens/dfetch
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()
コード例 #3
0
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()
コード例 #4
0
    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")
コード例 #5
0
ファイル: test_manifest.py プロジェクト: jgeudens/dfetch
def test_no_manifests_found() -> None:

    with patch("dfetch.manifest.manifest.find_file"):

        with pytest.raises(RuntimeError):
            find_manifest()