Skip to content

Commit

Permalink
remove unitended changes and address comments rucio#6059
Browse files Browse the repository at this point in the history
  • Loading branch information
panta-123 committed Nov 26, 2024
1 parent decdb5b commit 8dd3ce8
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 20 deletions.
4 changes: 2 additions & 2 deletions lib/rucio/core/did_meta_plugins/filter_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,10 +362,10 @@ def create_elastic_query(
additional_filters: Optional["Iterable[FilterTuple]"] = None
) -> dict[str, Any]:
"""
Returns an single elastic query dictionary describing the filters expression.
Returns a single elastic query dictionary describing the filters expression.
:param additional_filters: additional filters to be applied to all clauses.
:returns: a elastic query dictionary describing the filters expression.
:returns: an elastic query dictionary describing the filters expression.
"""

additional_filters = additional_filters or []
Expand Down
6 changes: 4 additions & 2 deletions requirements/requirements.dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,11 @@ docstring-parser==0.11
dogpile-cache==1.2.2
# via -r requirements.server.txt
elastic-transport==8.15.1
# via elasticsearch
# via
# -r requirements.server.txt
# elasticsearch
elasticsearch==8.15.1
# via -r requirements.server.in
# via -r requirements.server.txt
exceptiongroup==1.2.1
# via pytest
execnet==2.1.1
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements.server.in
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ PyYAML==6.0.1 # globus_extras and
globus-sdk==3.41.0 # globus_extras
python3-saml==1.16.0 # saml_extras
pymongo==4.8.0 # pymongo (metadata plugin)
elasticsearch>=8.0.0 # elasticsearch ( metadata plugin)
elasticsearch==8.15.1 # elasticsearch ( metadata plugin)
libtorrent==2.0.9 # Support for the bittorrent transfertool
qbittorrent-api==2023.11.57 # qBittorrent plugin for the bittorrent tranfsertool
30 changes: 15 additions & 15 deletions tests/test_did_meta_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,17 +168,26 @@ def test_list_did_meta(self, mock_scope, root_account):
expected = sorted([tmp_dsn1, tmp_dsn4])
assert expected == results

results = list(list_dids(mock_scope, {meta_key1: meta_value2}))
dids = list_dids(mock_scope, {meta_key1: meta_value2})
results = []
for d in dids:
results.append(d)
assert len(results) == 1
# assert [{'scope': (tmp_scope), 'name': str(tmp_dsn2)}] == results
assert [tmp_dsn2] == results

results = list(list_dids(mock_scope, {meta_key2: meta_value1}))
dids = list_dids(mock_scope, {meta_key2: meta_value1})
results = []
for d in dids:
results.append(d)
assert len(results) == 1
# assert [{'scope': (tmp_scope), 'name': tmp_dsn3}] == results
assert [tmp_dsn3] == results

results = list(list_dids(mock_scope, {meta_key2: meta_value1}))
dids = list_dids(mock_scope, {meta_key1: meta_value1, meta_key2: meta_value2})
results = []
for d in dids:
results.append(d)
assert len(results) == 1
# assert [{'scope': (tmp_scope), 'name': tmp_dsn4}] == results
assert [tmp_dsn4] == results
Expand Down Expand Up @@ -356,24 +365,15 @@ def test_list_did_meta(self, mock_scope, root_account, elastic_meta):
expected = sorted([tmp_dsn1, tmp_dsn4])
assert expected == results

dids = elastic_meta.list_dids(mock_scope, {meta_key1: meta_value2})
results = []
for d in dids:
results.append(d)
results = list(elastic_meta.list_dids(mock_scope, {meta_key1: meta_value2}))
assert len(results) == 1
assert [tmp_dsn2] == results

dids = elastic_meta.list_dids(mock_scope, {meta_key2: meta_value1})
results = []
for d in dids:
results.append(d)
results = list(elastic_meta.list_dids(mock_scope, {meta_key2: meta_value1}))
assert len(results) == 1
assert [tmp_dsn3] == results

dids = elastic_meta.list_dids(mock_scope, {meta_key1: meta_value1, meta_key2: meta_value2})
results = []
for d in dids:
results.append(d)
results = list(elastic_meta.list_dids(mock_scope, {meta_key1: meta_value1, meta_key2: meta_value2}))
assert len(results) == 1
assert [tmp_dsn4] == results

Expand Down

0 comments on commit 8dd3ce8

Please sign in to comment.