From cf9874c59fa5a73d395743aaf71555b441161e3e Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Mon, 19 Jun 2017 14:12:41 -0300 Subject: [PATCH] 11778: Added explicit test that checks directory references upload behavior. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- sdk/python/tests/test_arv_put.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sdk/python/tests/test_arv_put.py b/sdk/python/tests/test_arv_put.py index dd002c1906..3e9c94516c 100644 --- a/sdk/python/tests/test_arv_put.py +++ b/sdk/python/tests/test_arv_put.py @@ -841,6 +841,23 @@ class ArvPutIntegrationTest(run_test_server.TestCaseWithServers, c = arv_put.api_client.collections().get(uuid=updated_col['uuid']).execute() self.assertRegex(c['manifest_text'], r'^\..* .*:44:file2\n') + def test_upload_directory_reference_as_subcollection(self): + tmpdir1 = self.make_tmpdir() + tmpdir2 = self.make_tmpdir() + with open(os.path.join(tmpdir1, 'foo'), 'w') as f: + f.write('This is foo') + with open(os.path.join(tmpdir2, 'bar'), 'w') as f: + f.write('This is not foo') + # Upload one directory and one file + col = self.run_and_find_collection("", ['--no-progress', + tmpdir1, + os.path.join(tmpdir2, 'bar')]) + self.assertNotEqual(None, col['uuid']) + c = arv_put.api_client.collections().get(uuid=col['uuid']).execute() + # Check that 'foo' was written inside a subcollection + # OTOH, 'bar' should have been directly uploaded on the root collection + self.assertRegex(c['manifest_text'], r'^\. .*:15:bar\n\./.+ .*:11:foo\n') + def test_put_collection_with_high_redundancy(self): # Write empty data: we're not testing CollectionWriter, just # making sure collections.create tells the API server what our -- 2.30.2