示例#1
0
 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 项目: Larry7/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'))
示例#3
0
 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'))
示例#4
0
文件: test_utils.py 项目: Larry7/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'))