783feee3639953f11654cdd9284d6b8b0d6b5a26,tests/python/pants_test/binaries/test_binary_util.py,BinaryUtilTest,test_support_url_multi,#BinaryUtilTest#,62

Before Change


    with binary_util._select_binary_stream(name="protoc", binary_path=binary_path) as stream:
      stream()
      count += 1
    self.assertEqual(count, 1)

  def test_support_url_fallback(self):
    Tests fallback behavior with multiple support baseurls.

After Change


  def test_support_url_multi(self):
    Tests to make sure existing base urls function as expected.

    with temporary_dir() as invalid_local_files, temporary_dir() as valid_local_files:
      binary_util = BinaryUtil(
        baseurls=[
          "BLATANTLY INVALID URL",
          "https://dl.bintray.com/pantsbuild/bin/reasonably-invalid-url",
          invalid_local_files,
          valid_local_files,
          "https://dl.bintray.com/pantsbuild/bin/another-invalid-url",
        ],
        timeout_secs=30,
        bootstrapdir="/tmp")

      binary_path = binary_util._select_binary_base_path(supportdir="bin/protobuf",
                                                         version="2.4.1",
                                                         name="protoc")
      contents = b"proof"
      with safe_open(os.path.join(valid_local_files, binary_path), "wb") as fp:
        fp.write(contents)

      with binary_util._select_binary_stream(name="protoc", binary_path=binary_path) as stream:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: pantsbuild/pants
Commit Name: 783feee3639953f11654cdd9284d6b8b0d6b5a26
Time: 2016-07-23
Author: john.sirois@gmail.com
File Name: tests/python/pants_test/binaries/test_binary_util.py
Class Name: BinaryUtilTest
Method Name: test_support_url_multi


Project Name: pantsbuild/pants
Commit Name: 545a00c2bfc71bc08d453c8b4151413a63f8aa38
Time: 2018-10-28
Author: stuhood@twitter.com
File Name: tests/python/pants_test/backend/jvm/tasks/test_binary_create_integration.py
Class Name: BinaryCreateIntegrationTest
Method Name: test_deploy_excludes


Project Name: pantsbuild/pants
Commit Name: 6b11c59ad9ddaa6dc67542a895ff849cae7af15c
Time: 2018-09-04
Author: 1305167+cosmicexplorer@users.noreply.github.com
File Name: tests/python/pants_test/backend/python/tasks/test_python_distribution_integration.py
Class Name: PythonDistributionIntegrationTest
Method Name: test_python_distribution_with_setup_requires