On 08/17/2016 04:57 PM, Milan Kubík wrote:
On 08/17/2016 04:45 PM, Lenka Doudova wrote:
Hi,
attached patch provides fix for 2 out of three failing tests in
ipatests/test_ipalib/test_frontend.py. Failures were caused by
changes related to thin client implementation.
Fix for the third failure will be provided later (after my PTO), as
it will be more complicated fix.
Lenka
NACK:
* Module ipatests.test_ipalib.test_frontend
ipatests/test_ipalib/test_frontend.py:944:
[E1120(no-value-for-parameter), test_Object.test_init.FakeAPI] No
value for argument 'base' in constructor call)
--
Milan Kubik
Oh sorry, I attached non-updated patch...
Correct one attached now.
Lenka
From 6838b13e2eec3aab2aab5f67dbc273a3801f352c Mon Sep 17 00:00:00 2001
From: Lenka Doudova
Date: Wed, 17 Aug 2016 16:37:29 +0200
Subject: [PATCH] Tests: Fix failing tests in test_ipalib/test_frontend
Some tests in ipatests/test_ipalib/test_frontend.py are failing due to changes
related to thin client implementation. Providing fix for:
ipa.test_ipalib.test_frontend.test_Attribute.test_init
ipa.test_ipalib.test_frontend.test_LocalOrRemote.test_run
https://fedorahosted.org/freeipa/ticket/6188
---
ipalib/frontend.py| 2 +-
ipatests/test_ipalib/test_frontend.py | 12 ++--
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/ipalib/frontend.py b/ipalib/frontend.py
index 455b222d4d7fcbb65b43c4d8e1ffbbaf3e131d22..554d899d97539ab551abaa9983d68450e86454b1 100644
--- a/ipalib/frontend.py
+++ b/ipalib/frontend.py
@@ -1181,7 +1181,7 @@ class LocalOrRemote(Command):
When running in a server context, this command is always executed
locally and the value of ``options['server']`` is ignored.
"""
-if options['server'] and not self.env.in_server:
+if options.get('server', False) and not self.env.in_server:
return self.forward(*args, **options)
return self.execute(*args, **options)
diff --git a/ipatests/test_ipalib/test_frontend.py b/ipatests/test_ipalib/test_frontend.py
index c3dd9104c152dc9e9da774a53e0c6a42b9a89bf8..892328a37a8c923fbcf0236ccabb1c8b2d3183f3 100644
--- a/ipatests/test_ipalib/test_frontend.py
+++ b/ipatests/test_ipalib/test_frontend.py
@@ -862,13 +862,13 @@ class test_LocalOrRemote(ClassChecker):
api.finalize()
cmd = api.Command.example
assert cmd(version=u'2.47') == dict(
-result=('execute', (None,), dict(version=u'2.47', server=False))
+result=('execute', (), dict(version=u'2.47'))
)
assert cmd(u'var', version=u'2.47') == dict(
-result=('execute', (u'var',), dict(version=u'2.47', server=False))
+result=('execute', (u'var',), dict(version=u'2.47'))
)
assert cmd(server=True, version=u'2.47') == dict(
-result=('forward', (None,), dict(version=u'2.47', server=True))
+result=('forward', (), dict(version=u'2.47', server=True))
)
assert cmd(u'var', server=True, version=u'2.47') == dict(
result=('forward', (u'var',), dict(version=u'2.47', server=True))
@@ -880,13 +880,13 @@ class test_LocalOrRemote(ClassChecker):
api.finalize()
cmd = api.Command.example
assert cmd(version=u'2.47') == dict(
-result=('execute', (None,), dict(version=u'2.47', server=False))
+result=('execute', (), dict(version=u'2.47', server=False))
)
assert cmd(u'var', version=u'2.47') == dict(
result=('execute', (u'var',), dict(version=u'2.47', server=False))
)
assert cmd(server=True, version=u'2.47') == dict(
-result=('execute', (None,), dict(version=u'2.47', server=True))
+result=('execute', (), dict(version=u'2.47', server=True))
)
assert cmd(u'var', server=True, version=u'2.47') == dict(
result=('execute', (u'var',), dict(version=u'2.47', server=True))
@@ -1106,7 +1106,7 @@ class test_Attribute(ClassChecker):
"""
user_obj = 'The user frontend.Object instance'
class api(object):
-Object = dict(user=user_obj)
+Object = {("user", "1"): user_obj}
@staticmethod
def is_production_mode():
return False
--
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