Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeagle committed Dec 6, 2024
1 parent d2c6bfa commit c4612d5
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions protoc/private/prebuilt_protoc_toolchain_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,24 @@ load(":prebuilt_protoc_toolchain.bzl", "release_version_to_artifact_name")
load(":versions.bzl", "PROTOC_VERSIONS")

def _release_version_to_artifact_name_test_impl(ctx):
env = unittest.begin(ctx)
count = 0
env = unittest.begin(ctx)
count = 0

for release_version in PROTOC_VERSIONS:
artifact_name = release_version_to_artifact_name(release_version, "linux-x86_64")
artifact_dict = PROTOC_VERSIONS[release_version]
# there should be a linux-x86_64 artifact in every release
asserts.true(env, artifact_name in artifact_dict, "'{}' not found for release version '{}'".format(artifact_name, release_version))
count += 1
for release_version in PROTOC_VERSIONS:
artifact_name = release_version_to_artifact_name(release_version, "linux-x86_64")
artifact_dict = PROTOC_VERSIONS[release_version]

asserts.true(env, count > 0, "no versions tested")
return unittest.end(env)
# there should be a linux-x86_64 artifact in every release
asserts.true(env, artifact_name in artifact_dict, "'{}' not found for release version '{}'".format(artifact_name, release_version))
count += 1

asserts.true(env, count > 0, "no versions tested")
return unittest.end(env)

release_version_to_artifact_name_test = unittest.make(_release_version_to_artifact_name_test_impl)

def release_version_to_artifact_name_test_suite():
unittest.suite(
"release_version_to_artifact_name_tests",
release_version_to_artifact_name_test,
)
unittest.suite(
"release_version_to_artifact_name_tests",
release_version_to_artifact_name_test,
)

0 comments on commit c4612d5

Please sign in to comment.