Skip to content

Commit

Permalink
fix test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmicexplorer committed Dec 27, 2019
1 parent 0d5bbb0 commit d91944f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
setup_lambdex,
)
from pants.backend.awslambda.python.lambdex import Lambdex
from pants.backend.python.rules.download_pex_bin import download_pex_bin
from pants.backend.python.rules.download_pex_bin import DownloadedPexBin
from pants.backend.python.rules.download_pex_bin import rules as download_pex_bin_rules
from pants.backend.python.rules.inject_init import inject_init
from pants.backend.python.rules.pex import create_pex
from pants.backend.python.rules.pex_from_target_closure import create_pex_from_target_closure
Expand Down Expand Up @@ -51,7 +52,7 @@ def rules(cls):
create_pex_native_build_environment,
create_subprocess_encoding_environment,
strip_source_root,
download_pex_bin,
*download_pex_bin_rules(),
inject_init,
create_pex_from_target_closure,
RootRule(Digest),
Expand All @@ -62,12 +63,13 @@ def rules(cls):
RootRule(Lambdex),
RootRule(LambdexSetup),
RootRule(PythonAWSLambdaAdaptor),
RootRule(DownloadedPexBin.Factory),
]

def setUp(self):
super().setUp()
init_subsystems([SourceRootConfig, PythonSetup, PythonNativeCode,
SubprocessEnvironment, Lambdex])
SubprocessEnvironment, Lambdex, DownloadedPexBin.Factory])

def create_python_awslambda(self, addr: str) -> Tuple[str, bytes]:
lambdex_setup = self.request_single_product(
Expand All @@ -77,6 +79,7 @@ def create_python_awslambda(self, addr: str) -> Tuple[str, bytes]:
PythonNativeCode.global_instance(),
SubprocessEnvironment.global_instance(),
Lambdex.global_instance(),
DownloadedPexBin.Factory.global_instance(),
)
)
target = self.request_single_product(HydratedTarget, Address.parse(addr))
Expand Down
2 changes: 1 addition & 1 deletion tests/python/pants_test/binaries/test_binary_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ReplacingLegacyOptionsTool(BinaryToolBase):

class BinaryUtilFakeUname(BinaryUtil):

def _host_platform(self):
def host_platform(self):
return HostPlatform('xxx', 'yyy')


Expand Down
4 changes: 2 additions & 2 deletions tests/python/pants_test/binaries/test_binary_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def _fake_url(cls, binaries, base, binary_key):
supportdir, version, name = binaries[binary_key]
binary_request = binary_util._make_deprecated_binary_request(supportdir, version, name)

binary_path = binary_request.get_download_path(binary_util._host_platform())
binary_path = binary_request.get_download_path(binary_util.host_platform())
return f'{base}/{binary_path}'

@classmethod
Expand Down Expand Up @@ -148,7 +148,7 @@ def test_support_url_multi(self):
version='2.4.1',
name='protoc')

binary_path = binary_request.get_download_path(binary_util._host_platform())
binary_path = binary_request.get_download_path(binary_util.host_platform())
contents = b'proof'
with safe_open(os.path.join(valid_local_files, binary_path), 'wb') as fp:
fp.write(contents)
Expand Down

0 comments on commit d91944f

Please sign in to comment.