17224: Fix to have multiple clients connected to separate clusters
[arvados.git] / sdk / python / tests / manifest_examples.py
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: Apache-2.0
4
5 from __future__ import absolute_import
6 from builtins import range
7 from builtins import object
8 import arvados
9 from . import arvados_testutil as tutil
10
11 class ManifestExamples(object):
12     def make_manifest(self,
13                       bytes_per_block=1,
14                       blocks_per_file=1,
15                       files_per_stream=1,
16                       streams=1):
17         datablip = 'x' * bytes_per_block
18         data_loc = tutil.str_keep_locator(datablip)
19         with tutil.mock_keep_responses(data_loc, 200):
20             coll = arvados.CollectionWriter()
21             for si in range(0, streams):
22                 for fi in range(0, files_per_stream):
23                     with coll.open("stream{}/file{}.txt".format(si, fi)) as f:
24                         for bi in range(0, blocks_per_file):
25                             f.write(datablip)
26             return coll.manifest_text()