-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
953 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Copyright 2024 University of Calgary | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. |
53 changes: 53 additions & 0 deletions
53
tests/test_suite/search/conjunctions/test_advanced_distance_combos.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Copyright 2024 University of Calgary | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import pytest | ||
|
||
|
||
@pytest.mark.search_ro | ||
def test_simple(aurorax): | ||
distances = aurorax.search.conjunctions.create_advanced_distance_combos(500, ground=1, space=1) | ||
for _, val in distances.items(): | ||
assert val == 500 | ||
|
||
|
||
@pytest.mark.search_ro | ||
@pytest.mark.parametrize("ground,space,events,custom", [ | ||
[0, 0, 0, 0], | ||
[0, 0, 0, 1], | ||
[0, 0, 1, 0], | ||
[0, 0, 1, 1], | ||
[0, 1, 0, 0], | ||
[0, 1, 0, 1], | ||
[0, 1, 1, 0], | ||
[0, 1, 1, 1], | ||
[1, 0, 0, 0], | ||
[1, 0, 0, 1], | ||
[1, 0, 1, 0], | ||
[1, 0, 1, 1], | ||
[1, 1, 0, 0], | ||
[1, 1, 0, 1], | ||
[1, 1, 1, 0], | ||
[1, 1, 1, 1], | ||
]) | ||
def test_complex(aurorax, ground, space, events, custom): | ||
distances = aurorax.search.conjunctions.create_advanced_distance_combos( | ||
500, | ||
ground=ground, | ||
space=space, | ||
events=events, | ||
custom=custom, | ||
) | ||
for _, val in distances.items(): | ||
assert val == 500 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Copyright 2024 University of Calgary | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import pytest | ||
import pyaurorax | ||
|
||
|
||
@pytest.mark.search_ro | ||
def test_simple(aurorax, conjunction_search_obj): | ||
# get describe string | ||
describe_str = aurorax.search.conjunctions.describe(conjunction_search_obj) | ||
|
||
# test response | ||
assert describe_str is not None and describe_str != "" | ||
|
||
|
||
@pytest.mark.search_ro | ||
def test_search_object(aurorax, conjunction_search_obj): | ||
# get describe string | ||
describe_str = aurorax.search.conjunctions.describe(search_obj=conjunction_search_obj) | ||
|
||
# test response | ||
assert describe_str is not None and describe_str != "" | ||
|
||
|
||
@pytest.mark.search_ro | ||
def test_search_dict(aurorax, conjunction_search_dict): | ||
# get describe string | ||
describe_str = aurorax.search.conjunctions.describe(query_dict=conjunction_search_dict) | ||
|
||
# test response | ||
assert describe_str is not None and describe_str != "" | ||
|
||
|
||
@pytest.mark.search_ro | ||
def test_bad(aurorax): | ||
with pytest.raises(pyaurorax.AuroraXError) as e_info: | ||
aurorax.search.conjunctions.describe() | ||
assert "One of 'search_obj' or 'query_dict' must be supplied" in str(e_info) |
Oops, something went wrong.