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: