Skip to content

Commit

Permalink
upload: move dirac upload test to belle ii. rucio#6475
Browse files Browse the repository at this point in the history
  • Loading branch information
panta-123 committed Feb 6, 2024
1 parent 503e16c commit 09d3b22
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions tests/test_belleii.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def test_belle2_schema(rse_factory, did_factory, root_account, did_client):
validate_schema('did', {'name': name, 'scope': scope, 'type': 'CONTAINER'})

@skip_non_belleii
def test_upload_file_with_dirac(rse_factory, scope, rse_client, did_factory, download_client, did_client, file_factory):
def test_upload_file_with_dirac(rse_factory, rse_client, did_factory, download_client, did_client, file_factory):
"Upload with dirac (CLIENT): Test the functionality of the upload method"
rse1, rse1_id = rse_factory.make_srm_rse(deterministic=True)
rse_client.add_rse_attribute(rse=rse1, key='ANY', value='True')
Expand All @@ -141,19 +141,21 @@ def test_upload_file_with_dirac(rse_factory, scope, rse_client, did_factory, dow
download_dir = file_factory.base_dir
fn1 = did_name_generator('file', name_prefix='user')
fn2 = did_name_generator('file', name_prefix='user')
scope1 = extract_scope(fn1, [])[0]
scope2 = extract_scope(fn2, [])[0]

items = [
{
'path': local_file1,
'rse': rse1,
'did_scope': scope,
'did_scope': scope1,
'did_name': fn1,
'guid': generate_uuid()
},
{
'path': local_file2,
'rse': rse1,
'did_scope': scope,
'did_scope': scope2,
'did_name': fn2,
'guid': generate_uuid()
}
Expand All @@ -162,8 +164,8 @@ def test_upload_file_with_dirac(rse_factory, scope, rse_client, did_factory, dow
status = did_factory.upload_client.upload(items, dirac=True)
assert status == 0
# download the files
did1 = f"{scope}:{fn1}"
did2 = f"{scope}:{fn2}"
did1 = f"{scope1}:{fn1}"
did2 = f"{scope2}:{fn2}"
download_client.download_dids([
{'did': did1, 'base_dir': download_dir},
{'did': did2, 'base_dir': download_dir}
Expand Down Expand Up @@ -193,11 +195,12 @@ def test_upload_file_with_dirac(rse_factory, scope, rse_client, did_factory, dow
directories = fn3['lfn'].split('/')
dataset_name = "/".join(directories[0:-1])
local_file3 = file_factory.file_generator()
scope3 = extract_scope(dataset_name, [])[0]
items = [
{
'path': local_file3,
'rse': rse1,
'dataset_scope': scope,
'dataset_scope': scope3,
'dataset_name': dataset_name,
'guid': generate_uuid()
}]
Expand Down

0 comments on commit 09d3b22

Please sign in to comment.