Hi,
attached are patches that are fixing 3 failing tests in
test_ipalib/test_messages.py.
Lenka
From 11bd09d8b82630b959deebe265320221db815540 Mon Sep 17 00:00:00 2001
From: Lenka Doudova
Date: Mon, 15 Aug 2016 11:10:57 +0200
Subject: [PATCH 1/2] Fix malformed or missing docstrings in ipalib/messages
Some of the docstrings in ipalib/messages.py are malformed or missing
entirely. This causes test_ipalib/test_messages to fail due to non-matching
regex.
https://fedorahosted.org/freeipa/ticket/6215
---
ipalib/messages.py | 15 ---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/ipalib/messages.py b/ipalib/messages.py
index 6abad64a8259a8e164db60f63e75bbb9c230e7bf..02b0a0e1021fc2c59a139746eb35fb2d24b78945 100644
--- a/ipalib/messages.py
+++ b/ipalib/messages.py
@@ -397,7 +397,7 @@ class DNSForwardPolicyConflictWithEmptyZone(PublicMessage):
class DNSUpdateOfSystemRecordFailed(PublicMessage):
"""
-** 13022 ** Update of a DNS system record failed
+**13022** Update of a DNS system record failed
"""
errno = 13022
type = "warning"
@@ -408,7 +408,7 @@ class DNSUpdateOfSystemRecordFailed(PublicMessage):
class DNSUpdateNotIPAManagedZone(PublicMessage):
"""
-** 13023 ** Zone for system records is not managed by IPA
+**13023** Zone for system records is not managed by IPA
"""
errno = 13023
type = "warning"
@@ -419,6 +419,9 @@ class DNSUpdateNotIPAManagedZone(PublicMessage):
class AutomaticDNSRecordsUpdateFailed(PublicMessage):
+"""
+**13024** Automatic update of DNS records failed
+"""
errno = 13024
type = "warning"
format = _(
@@ -429,6 +432,9 @@ class AutomaticDNSRecordsUpdateFailed(PublicMessage):
class ServiceRestartRequired(PublicMessage):
+"""
+**13025** Service restart is required
+"""
errno = 13025
type = "warning"
format = _(
@@ -438,6 +444,9 @@ class ServiceRestartRequired(PublicMessage):
class LocationWithoutDNSServer(PublicMessage):
+"""
+**13026** Location without DNS server
+"""
errno = 13026
type = "warning"
format = _(
@@ -464,7 +473,7 @@ class ServerRemovalWarning(PublicMessage):
class CertificateInvalid(PublicMessage):
"""
-***13029 Failed to parse a certificate
+**13029** Failed to parse a certificate
"""
errno = 13029
type = "error"
--
2.7.4
From 11f4236f73bcff46297b24c5fde5f30e637d9b0c Mon Sep 17 00:00:00 2001
From: Lenka Doudova
Date: Mon, 15 Aug 2016 11:19:38 +0200
Subject: [PATCH] Tests: Add data attribute to messages
Tests test_ipalib/test_messages.py are failing because messages now contain
also 'data' attribute, which is not yet reflected in tests.
https://fedorahosted.org/freeipa/ticket/6185
---
ipatests/test_ipalib/test_messages.py | 21 -
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/ipatests/test_ipalib/test_messages.py b/ipatests/test_ipalib/test_messages.py
index dad0e988a6f0da1486e02af6c35e6657029e07ac..f6508b98a3cc2ae2d734fc92300fe858c59d6f58 100644
--- a/ipatests/test_ipalib/test_messages.py
+++ b/ipatests/test_ipalib/test_messages.py
@@ -55,10 +55,11 @@ class test_PublicMessages(test_errors.BaseMessagesTest):
def test_to_dict():
expected = dict(
-name='HelloMessage',
-type='info',
-message='Hello, world!',
+name=u'HelloMessage',
+type=u'info',
+message=u'Hello, world!',
code=1234,
+data={'greeting': 'Hello', 'object': 'world'},
)
assert HelloMessage(greeting='Hello', object='world').to_dict() == expected
@@ -78,15 +79,17 @@ def test_add_message():
assert result == {'messages': [
dict(
-name='HelloMessage',
-type='info',
-message='Hello, world!',
+name=u'HelloMessage',
+type=u'info',
+message=u'Hello, world!',
code=1234,
+data={'greeting': 'Hello', 'object': 'world'},
),
dict(
-name='HelloMessage',
-type='info',
-message='Hi, version!',
+name=u'HelloMessage',
+type=u'info',
+message=u'Hi, version!',
code=1234,
+data={'greeting': 'Hi', 'object': 'version'},
)
]}
--
2.7.4
--
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code