summaryrefslogtreecommitdiff
path: root/tests/frontend/large_directory.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/frontend/large_directory.py')
-rw-r--r--tests/frontend/large_directory.py25
1 files changed, 9 insertions, 16 deletions
diff --git a/tests/frontend/large_directory.py b/tests/frontend/large_directory.py
index 921e2ddbe..ea29fd1ca 100644
--- a/tests/frontend/large_directory.py
+++ b/tests/frontend/large_directory.py
@@ -29,10 +29,7 @@ from tests.testutils import create_artifact_share, assert_shared
# Project directory
-DATA_DIR = os.path.join(
- os.path.dirname(os.path.realpath(__file__)),
- "project",
-)
+DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "project",)
@contextmanager
@@ -40,7 +37,7 @@ def limit_grpc_message_length(limit):
orig_insecure_channel = grpc.insecure_channel
def new_insecure_channel(target):
- return orig_insecure_channel(target, options=(('grpc.max_send_message_length', limit),))
+ return orig_insecure_channel(target, options=(("grpc.max_send_message_length", limit),))
grpc.insecure_channel = new_insecure_channel
try:
@@ -58,29 +55,25 @@ def test_large_directory(cli, tmpdir, datafiles):
MAX_MESSAGE_LENGTH = 1024 * 1024
NUM_FILES = MAX_MESSAGE_LENGTH // 64 + 1
- large_directory_dir = os.path.join(project, 'files', 'large-directory')
+ large_directory_dir = os.path.join(project, "files", "large-directory")
os.mkdir(large_directory_dir)
for i in range(NUM_FILES):
- with open(os.path.join(large_directory_dir, str(i)), 'w') as f:
+ with open(os.path.join(large_directory_dir, str(i)), "w") as f:
# The files need to have different content as we want different digests.
f.write(str(i))
- with create_artifact_share(os.path.join(str(tmpdir), 'artifactshare')) as share:
+ with create_artifact_share(os.path.join(str(tmpdir), "artifactshare")) as share:
# Configure bst to push to the artifact share
- cli.configure({
- 'artifacts': [
- {'url': share.repo, 'push': True},
- ]
- })
+ cli.configure({"artifacts": [{"url": share.repo, "push": True},]})
# Enforce 1 MB gRPC message limit
with limit_grpc_message_length(MAX_MESSAGE_LENGTH):
# Build and push
- result = cli.run(project=project, args=['build', 'import-large-directory.bst'])
+ result = cli.run(project=project, args=["build", "import-large-directory.bst"])
result.assert_success()
# Assert that we are now cached locally
- assert cli.get_element_state(project, 'import-large-directory.bst') == 'cached'
+ assert cli.get_element_state(project, "import-large-directory.bst") == "cached"
# Assert that the push was successful
- assert_shared(cli, share, project, 'import-large-directory.bst')
+ assert_shared(cli, share, project, "import-large-directory.bst")