| |
@@ -3,6 +3,7 @@
|
| |
import logging
|
| |
import os
|
| |
import re
|
| |
+ import sys
|
| |
import time
|
| |
from unittest.mock import call, MagicMock, Mock, patch
|
| |
import xmlrpc
|
| |
@@ -700,35 +701,67 @@
|
| |
),
|
| |
]
|
| |
|
| |
- assert toddler.errors == {
|
| |
- "bugzilla_raw": [
|
| |
- "foo -- The name khorne@fedoraproject.org is not a valid username",
|
| |
- "foo -- The name khorne@fedoraproject.org is not a valid username",
|
| |
- ],
|
| |
- "bugzilla": [
|
| |
- "Failed to update: `Fedora/foo`:\n"
|
| |
- " Error('The name khorne@fedoraproject.org is not a valid username')\n"
|
| |
+ if sys.version_info.major == 3 and sys.version_info.minor == 6:
|
| |
+ assert toddler.errors == {
|
| |
+ "bugzilla_raw": [
|
| |
+ "foo -- The name khorne@fedoraproject.org is not a valid username",
|
| |
+ "foo -- The name khorne@fedoraproject.org is not a valid username",
|
| |
+ ],
|
| |
+ "bugzilla": [
|
| |
+ "Failed to update: `Fedora/foo`:\n"
|
| |
+ " Error('The name khorne@fedoraproject.org is not a valid username',)\n"
|
| |
+ " ('The name khorne@fedoraproject.org is not a valid username',)",
|
| |
+ "Failed to update: `Fedora EPEL/foo`:\n"
|
| |
+ " Error('The name khorne@fedoraproject.org is not a valid username',)\n"
|
| |
+ " ('The name khorne@fedoraproject.org is not a valid username',)",
|
| |
+ ],
|
| |
+ "configuration": [],
|
| |
+ "PDC": [],
|
| |
+ "mails": [],
|
| |
+ }
|
| |
+ else:
|
| |
+ assert toddler.errors == {
|
| |
+ "bugzilla_raw": [
|
| |
+ "foo -- The name khorne@fedoraproject.org is not a valid username",
|
| |
+ "foo -- The name khorne@fedoraproject.org is not a valid username",
|
| |
+ ],
|
| |
+ "bugzilla": [
|
| |
+ "Failed to update: `Fedora/foo`:\n"
|
| |
+ " Error('The name khorne@fedoraproject.org is not a valid username')\n"
|
| |
+ " ('The name khorne@fedoraproject.org is not a valid username',)",
|
| |
+ "Failed to update: `Fedora EPEL/foo`:\n"
|
| |
+ " Error('The name khorne@fedoraproject.org is not a valid username')\n"
|
| |
+ " ('The name khorne@fedoraproject.org is not a valid username',)",
|
| |
+ ],
|
| |
+ "configuration": [],
|
| |
+ "PDC": [],
|
| |
+ "mails": [],
|
| |
+ }
|
| |
+
|
| |
+ if sys.version_info.major == 3 and sys.version_info.minor == 6:
|
| |
+ report = [
|
| |
+ "ERROR REPORT",
|
| |
+ "bugzilla",
|
| |
+ " - Failed to update: `Fedora/foo`:\n"
|
| |
+ " Error('The name khorne@fedoraproject.org is not a valid username',)\n"
|
| |
+ " ('The name khorne@fedoraproject.org is not a valid username',)\n"
|
| |
+ " - Failed to update: `Fedora EPEL/foo`:\n"
|
| |
+ " Error('The name khorne@fedoraproject.org is not a valid username',)\n"
|
| |
" ('The name khorne@fedoraproject.org is not a valid username',)",
|
| |
- "Failed to update: `Fedora EPEL/foo`:\n"
|
| |
+ "",
|
| |
+ ]
|
| |
+ else:
|
| |
+ report = [
|
| |
+ "ERROR REPORT",
|
| |
+ "bugzilla",
|
| |
+ " - Failed to update: `Fedora/foo`:\n"
|
| |
+ " Error('The name khorne@fedoraproject.org is not a valid username')\n"
|
| |
+ " ('The name khorne@fedoraproject.org is not a valid username',)\n"
|
| |
+ " - Failed to update: `Fedora EPEL/foo`:\n"
|
| |
" Error('The name khorne@fedoraproject.org is not a valid username')\n"
|
| |
" ('The name khorne@fedoraproject.org is not a valid username',)",
|
| |
- ],
|
| |
- "PDC": [],
|
| |
- "configuration": [],
|
| |
- "mails": [],
|
| |
- }
|
| |
-
|
| |
- report = [
|
| |
- "ERROR REPORT",
|
| |
- "bugzilla",
|
| |
- " - Failed to update: `Fedora/foo`:\n"
|
| |
- " Error('The name khorne@fedoraproject.org is not a valid username')\n"
|
| |
- " ('The name khorne@fedoraproject.org is not a valid username',)\n"
|
| |
- " - Failed to update: `Fedora EPEL/foo`:\n"
|
| |
- " Error('The name khorne@fedoraproject.org is not a valid username')\n"
|
| |
- " ('The name khorne@fedoraproject.org is not a valid username',)",
|
| |
- "",
|
| |
- ]
|
| |
+ "",
|
| |
+ ]
|
| |
|
| |
mock_notify.notify_admins_distgit_sync_error.assert_called_with(
|
| |
"bastion", "root@localhost", ["root@localhost.localdomain"], report
|
| |
@@ -908,15 +941,14 @@
|
| |
"********************************************************************************"
|
| |
in caplog.text
|
| |
)
|
| |
-
|
| |
- assert (
|
| |
- "ERROR REPORT\n"
|
| |
- "mails\n"
|
| |
- " - `Slaanesh` has no bugzilla_email or mailing_list set on `Fedora/foo`\n"
|
| |
- " - `Khorne` has no bugzilla_email or mailing_list set on `Fedora/foo`\n"
|
| |
- " - `Slaanesh` has no bugzilla_email or mailing_list set on `Fedora EPEL/foo`\n"
|
| |
- in caplog.text
|
| |
- )
|
| |
+ for line in (
|
| |
+ "ERROR REPORT\n",
|
| |
+ "mails\n",
|
| |
+ " - `Slaanesh` has no bugzilla_email or mailing_list set on `Fedora/foo`\n",
|
| |
+ " - `Khorne` has no bugzilla_email or mailing_list set on `Fedora/foo`\n",
|
| |
+ " - `Slaanesh` has no bugzilla_email or mailing_list set on `Fedora EPEL/foo`\n",
|
| |
+ ):
|
| |
+ assert line in caplog.text
|
| |
|
| |
assert "Building the data structure" in caplog.text
|
| |
|
| |
It looks like python 3.6 behaves differently from 3.7 and 3.8 which are
in the test matrix and the error message in the tests need to take that
into account.
Signed-off-by: Pierre-Yves Chibon pingou@pingoured.fr