Merge branch '8784-dir-listings'
[arvados.git] / crunch_scripts / test / task_output_dir
1 #!/usr/bin/env python
2 # Copyright (C) The Arvados Authors. All rights reserved.
3 #
4 # SPDX-License-Identifier: Apache-2.0
5
6 import arvados
7 import arvados.crunch
8 import hashlib
9 import os
10
11 out = arvados.crunch.TaskOutputDir()
12
13 string = open(__file__).read()
14 with open(os.path.join(out.path, 'example.out'), 'w') as f:
15     f.write(string)
16 with open(os.path.join(out.path, 'example.out.SHA1'), 'w') as f:
17     f.write(hashlib.sha1(string).hexdigest() + "\n")
18
19 arvados.current_task().set_output(out.manifest_text())