def test_hashed_install_success(script, data, tmpdir):
 file_url = path_to_url((data.packages / 'simple-1.0.tar.gz').abspath)
 with requirements_file('simple2==1.0 --hash=sha256:9336af72ca661e6336eb87bc7de3e8844d853e3848c2b9bbd2e8bf01db88c2c7\n{simple} --hash=sha256:393043e672415891885c9a2a0929b1af95fb866d6ca016b42d2e6ce53619b653'.format(simple=file_url), tmpdir) as reqs_file:
  script.pip_install_local('-r', reqs_file.abspath, expect_error=False)

def test_hashed_install_success ( script , data , tmpdir ) : file_url = path_to_url ( ( data . packages / 'simple-1.0.tar.gz' ) . abspath ) with requirements_file ( 'simple2==1.0 --hash=sha256:9336af72ca661e6336eb87bc7de3e8844d853e3848c2b9bbd2e8bf01db88c2c7\n{simple} --hash=sha256:393043e672415891885c9a2a0929b1af95fb866d6ca016b42d2e6ce53619b653' . format ( simple = file_url ) , tmpdir ) as reqs_file : script . pip_install_local ( '-r' , reqs_file . abspath , expect_error = False )
test that installing various sorts of requirements with correct hashes works .