-
Notifications
You must be signed in to change notification settings - Fork 8
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
1 parent
e97628a
commit 8e5a36d
Showing
7 changed files
with
56 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import pytest | ||
import tube.settings as config | ||
|
||
from tube.utils.dd import init_dictionary | ||
from unittest.mock import patch | ||
from tests.util import mock_dictionary_url, initialize_mappings | ||
from tube.etl.indexers.injection.parser import Parser as InjectionParser | ||
|
||
@pytest.fixture(scope="function") | ||
@patch("tube.etl.indexers.injection.parser.Parser.get_edges_having_data") | ||
@patch( | ||
"dictionaryutils.load_schemas_from_url", | ||
) | ||
def test_create_prop_from_json(): | ||
""" | ||
Unit test for parser to check if the property created is correct. | ||
""" | ||
from tube.etl.indexers.base.parser import Parser | ||
|
||
dictionary_url_patcher = patch( | ||
"dictionaryutils.load_schemas_from_url", | ||
return_value=mock_dictionary_url("midrc"), | ||
) | ||
dictionary_url_patcher.start() | ||
dictionary, model = init_dictionary("nor_used_url") | ||
|
||
for e in model.Edge.get_subclasses(): | ||
print(e.__tablename__) | ||
|
||
mapping = initialize_mappings("midrc", "data_file") | ||
parser = InjectionParser(mapping, model, dictionary) | ||
for prop in parser.props: | ||
assert prop.type is not None |
File renamed without changes.