コード例 #1
0
ファイル: test_utils.py プロジェクト: murrayrush/pip
 def test_unknown_hash(self):
     """Hashes should raise InstallationError when it encounters an unknown
     hash."""
     hashes = Hashes({'badbad': ['dummy']})
     with pytest.raises(InstallationError):
         hashes.check_against_file(BytesIO(b'hello'))
コード例 #2
0
ファイル: test_utils.py プロジェクト: murrayrush/pip
 def test_failure(self):
     """Hashes should raise HashMismatch when no hashes match."""
     hashes = Hashes({'sha256': ['wrongwrong']})
     with pytest.raises(HashMismatch):
         hashes.check_against_file(BytesIO(b'hello'))
コード例 #3
0
ファイル: test_utils.py プロジェクト: jonparrott/pip
 def test_unknown_hash(self):
     """Hashes should raise InstallationError when it encounters an unknown
     hash."""
     hashes = Hashes({'badbad': ['dummy']})
     with pytest.raises(InstallationError):
         hashes.check_against_file(BytesIO(b'hello'))
コード例 #4
0
ファイル: test_utils.py プロジェクト: jonparrott/pip
 def test_failure(self):
     """Hashes should raise HashMismatch when no hashes match."""
     hashes = Hashes({'sha256': ['wrongwrong']})
     with pytest.raises(HashMismatch):
         hashes.check_against_file(BytesIO(b'hello'))
コード例 #5
0
ファイル: test_utils.py プロジェクト: pradyunsg/pip
 def test_unknown_hash(self) -> None:
     """Hashes should raise InstallationError when it encounters an unknown
     hash."""
     hashes = Hashes({"badbad": ["dummy"]})
     with pytest.raises(InstallationError):
         hashes.check_against_file(BytesIO(b"hello"))
コード例 #6
0
ファイル: test_utils.py プロジェクト: pradyunsg/pip
 def test_failure(self) -> None:
     """Hashes should raise HashMismatch when no hashes match."""
     hashes = Hashes({"sha256": ["wrongwrong"]})
     with pytest.raises(HashMismatch):
         hashes.check_against_file(BytesIO(b"hello"))