-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged in hotfix/OPT-353 (pull request #85)
[OPT-353] to main Approved-by: David Fernandez Vigo Approved-by: David Antolín Álvarez
- Loading branch information
Showing
4 changed files
with
109 additions
and
129 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,24 @@ | ||
from unittest.mock import patch, MagicMock | ||
|
||
from startleft.iac.mapping.mapper import get_tags | ||
|
||
|
||
class TestMapper: | ||
|
||
@patch("startleft.iac.mapping.sourcemodel.SourceModel") | ||
def test_get_tags_with_mapping_str(self, mock_source_model): | ||
mock_source_model.search.return_value = 'value' | ||
c_tags = get_tags(mock_source_model, MagicMock(), MagicMock()) | ||
assert len(c_tags) is 1 | ||
|
||
@patch("startleft.iac.mapping.sourcemodel.SourceModel") | ||
def test_get_tags_with_mapping_list(self, mock_source_model): | ||
mock_source_model.search.return_value = 'value' | ||
c_tags = get_tags(mock_source_model, MagicMock(), [MagicMock(), MagicMock()]) | ||
assert len(c_tags) is 2 | ||
|
||
@patch("startleft.iac.mapping.sourcemodel.SourceModel") | ||
def test_get_tags_with_attribute_not_found(self, mock_source_model): | ||
mock_source_model.search.return_value = [] | ||
c_tags = get_tags(mock_source_model, MagicMock(), MagicMock()) | ||
assert len(c_tags) is 0 |
Oops, something went wrong.