-
Notifications
You must be signed in to change notification settings - Fork 11
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
3 changed files
with
65 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import pytest | ||
from discoverx.explorer import InfoFetcher, TagsInfo, TagInfo | ||
|
||
|
||
def test_validate_from_components(): | ||
info_table = TagsInfo([], [TagInfo("a", "v1")], [], []) | ||
info_schema = TagsInfo([], [], [TagInfo("a", "v1")], []) | ||
info_catalog = TagsInfo([], [], [], [TagInfo("a", "v1")]) | ||
info_no_tags = TagsInfo([], [], [], []) | ||
|
||
assert InfoFetcher._contains_all_tags(info_table, [TagInfo("a", "v1")]) | ||
assert not InfoFetcher._contains_all_tags(info_table, [TagInfo("a", "v2")]) | ||
assert not InfoFetcher._contains_all_tags(info_table, [TagInfo("b", "v1")]) | ||
assert not InfoFetcher._contains_all_tags(info_table, [TagInfo("a", None)]) | ||
# If no tags to check, then it should be true | ||
assert InfoFetcher._contains_all_tags(info_table, []) | ||
|
||
assert InfoFetcher._contains_all_tags(info_schema, [TagInfo("a", "v1")]) | ||
|
||
assert InfoFetcher._contains_all_tags(info_catalog, [TagInfo("a", "v1")]) | ||
|
||
assert InfoFetcher._contains_all_tags(info_no_tags, []) | ||
assert not InfoFetcher._contains_all_tags(info_no_tags, [TagInfo("a", "v1")]) |