Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Updates after PR review
Browse files Browse the repository at this point in the history
  • Loading branch information
nicain committed Oct 11, 2021
1 parent 9764f19 commit 6bbaa7d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Expand Up @@ -11,4 +11,4 @@
/samples/**/*.py @googleapis/cdpe-cloudai

# The python-samples-owners team is the default owner for samples
/samples/**/*.py @aribray @sirtorry @googleapis/python-samples-owners
/samples/**/*.py @aribray @googleapis/python-samples-owners
Expand Up @@ -48,15 +48,19 @@ def on_backoff(invocation_dict):
invocation_dict['kwargs']['bucket'] = next(get_ephemeral_bucket())


@backoff.on_exception(wait_gen=lambda : iter([100, 250, 300, 500]), exception=Exception, max_tries=5, on_backoff=on_backoff)
# If necessary, retry test function while backing off the timeout sequentially
MAX_TIMEOUT = 500


@backoff.on_exception(wait_gen=lambda : iter([100, 250, 300, MAX_TIMEOUT]), exception=Exception, max_tries=5, on_backoff=on_backoff)
def test_batch_translate_text_with_glossary(capsys, bucket):

translate_v3_batch_translate_text_with_glossary.batch_translate_text_with_glossary(
"gs://cloud-samples-data/translation/text_with_glossary.txt",
"gs://{}/translation/BATCH_TRANSLATION_GLOS_OUTPUT/".format(bucket.name),
PROJECT_ID,
GLOSSARY_ID,
500)
MAX_TIMEOUT)

out, _ = capsys.readouterr()
assert "Total Characters: 9" in out

0 comments on commit 6bbaa7d

Please sign in to comment.