From e1d896052db8db92e4545e27ea57fa84b684b107 Mon Sep 17 00:00:00 2001 From: Martin Kopta Date: Tue, 9 May 2017 18:44:33 +0200 Subject: [PATCH] unit test for #24330 (#24346) --- test/units/modules/packaging/os/test_yum.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/units/modules/packaging/os/test_yum.py b/test/units/modules/packaging/os/test_yum.py index dbc8a71adda..59c22411b9d 100644 --- a/test/units/modules/packaging/os/test_yum.py +++ b/test/units/modules/packaging/os/test_yum.py @@ -116,6 +116,16 @@ Security: kernel-3.10.0-327.28.2.el7.x86_64 is an installed security update Security: kernel-3.10.0-327.22.2.el7.x86_64 is the currently running version """ +longname = """ +Loaded plugins: fastestmirror, priorities, rhnplugin +This system is receiving updates from RHN Classic or Red Hat Satellite. +Loading mirror speeds from cached hostfile + +xxxxxxxxxxxxxxxxxxxxxxxxxx.noarch + 1.16-1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +glibc.x86_64 2.17-157.el7_3.1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx""" + + unwrapped_output_rhel7_obsoletes = unwrapped_output_rhel7 + wrapped_output_rhel7_obsoletes_postfix unwrapped_output_rhel7_expected_pkgs = ["NetworkManager-openvpn", "NetworkManager-openvpn-gnome", "cabal-install", "cgit", "python34-libs", "python34-test", "python34-tkinter", @@ -135,6 +145,11 @@ class TestYumUpdateCheckParse(unittest.TestCase): expected_pkgs = [] self._assert_expected(expected_pkgs, res) + def test_longname(self): + res = yum.parse_check_update(longname) + expected_pkgs = ['xxxxxxxxxxxxxxxxxxxxxxxxxx', 'glibc'] + self._assert_expected(expected_pkgs, res) + def test_plugin_load_error(self): res = yum.parse_check_update(yum_plugin_load_error) expected_pkgs = []