mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
Add unit test for repack_pkgs function
This commit is contained in:
parent
113e5de656
commit
8001a568e0
1 changed files with 12 additions and 0 deletions
|
@ -7,6 +7,7 @@ import salt.modules.pkg_resource as pkg_resource
|
|||
import salt.utils.data
|
||||
import salt.utils.yaml
|
||||
import yaml
|
||||
from salt.exceptions import CommandExecutionError
|
||||
from tests.support.mock import MagicMock, patch
|
||||
|
||||
|
||||
|
@ -223,6 +224,17 @@ def test_format_pkg_list_with_attr():
|
|||
assert sorted(pkgs) == sorted(expected_pkg_list)
|
||||
|
||||
|
||||
def test_repack_pkgs():
|
||||
"""
|
||||
Test to check that repack function is raising error in case of
|
||||
package name collisions
|
||||
"""
|
||||
assert pkg_resource._repack_pkgs([{"A": "a"}])
|
||||
assert pkg_resource._repack_pkgs([{"A": "a"}, {"B": "b"}])
|
||||
with pytest.raises(CommandExecutionError):
|
||||
assert pkg_resource._repack_pkgs([{"A": "a"}, {"A": "c"}])
|
||||
|
||||
|
||||
def test_stringify():
|
||||
"""
|
||||
Test to takes a dict of package name/version information
|
||||
|
|
Loading…
Add table
Reference in a new issue