URL: https://github.com/freeipa/freeipa/pull/2040 Author: tiran Title: #2040: [Backport][ipa-4-6] Replace some test case adjectives Action: opened
PR body: """ This PR was opened automatically because PR #2036 was pushed to master and backport to ipa-4-6 is required. """ To pull the PR as Git branch: git remote add ghfreeipa https://github.com/freeipa/freeipa git fetch ghfreeipa pull/2040/head:pr2040 git checkout pr2040
From 78bfcfd504db43555ef26407106581ed2c4a455f Mon Sep 17 00:00:00 2001 From: Rob Crittenden <rcrit...@redhat.com> Date: Mon, 18 Jun 2018 15:04:20 -0400 Subject: [PATCH] Replace some test case adjectives Signed-off-by: Rob Crittenden <rcrit...@redhat.com> --- ipatests/test_ipalib/test_cli.py | 4 +-- ipatests/test_ipalib/test_parameters.py | 4 +-- ipatests/test_ipalib/test_text.py | 2 +- ipatests/test_util.py | 43 ++++++++++++++++++--------------- 4 files changed, 28 insertions(+), 25 deletions(-) diff --git a/ipatests/test_ipalib/test_cli.py b/ipatests/test_ipalib/test_cli.py index c240b2b024..86b366ef41 100644 --- a/ipatests/test_ipalib/test_cli.py +++ b/ipatests/test_ipalib/test_cli.py @@ -41,10 +41,10 @@ def test_max_col_width(self): assert str(e) == 'rows: need %r or %r; got %r' % (list, tuple, 'hello') rows = [ 'hello', - 'naughty', + 'empathetic', 'nurse', ] - assert o.max_col_width(rows) == len('naughty') + assert o.max_col_width(rows) == len('empathetic') rows = ( ( 'a', 'bbb', 'ccccc'), ('aa', 'bbbb', 'cccccc'), diff --git a/ipatests/test_ipalib/test_parameters.py b/ipatests/test_ipalib/test_parameters.py index a8b72dd1c0..5db7aa5fc9 100644 --- a/ipatests/test_ipalib/test_parameters.py +++ b/ipatests/test_ipalib/test_parameters.py @@ -1156,10 +1156,10 @@ class test_StrEnum(EnumChecker): _cls = parameters.StrEnum _name = 'my_strenum' _datatype = unicode - _test_values = u'Hello', u'naughty', u'nurse!' + _test_values = u'Hello', u'tall', u'nurse!' _bad_type_values = u'Hello', 1, u'nurse!' _bad_type = int - _translation = u"values='Hello', 'naughty', 'nurse!'" + _translation = u"values='Hello', 'tall', 'nurse!'" _bad_values = u'Howdy', u'quiet', u'library!' _single_value_translation = u"value='Hello'" diff --git a/ipatests/test_ipalib/test_text.py b/ipatests/test_ipalib/test_text.py index 37281441db..32756716a9 100644 --- a/ipatests/test_ipalib/test_text.py +++ b/ipatests/test_ipalib/test_text.py @@ -197,7 +197,7 @@ def test_unicode(self): def test_mod(self): inst = self.klass('hello %(adj)s nurse', 'foo', 'bar') - assert inst % dict(adj='naughty', stuff='junk') == 'hello naughty nurse' + assert inst % dict(adj='tall', stuff='junk') == 'hello tall nurse' def test_eq(self): inst1 = self.klass('what up?', 'foo', 'bar') diff --git a/ipatests/test_util.py b/ipatests/test_util.py index 9720aee4ca..0460588d1d 100644 --- a/ipatests/test_util.py +++ b/ipatests/test_util.py @@ -195,12 +195,12 @@ def exp_str(s): # Test with good compound values: a = [ u'hello', - dict(naughty=u'nurse'), + dict(profession=u'nurse'), 18, ] b = [ u'hello', - dict(naughty=u'nurse'), + dict(profession=u'nurse'), 18, ] f(a, b) @@ -208,7 +208,7 @@ def exp_str(s): # Test with bad compound values: b = [ b'hello', - dict(naughty=u'nurse'), + dict(profession=u'nurse'), 18, ] e = raises(AssertionError, f, a, b, 'foo') @@ -218,17 +218,17 @@ def exp_str(s): b = [ u'hello', - dict(naughty=b'nurse'), + dict(profession=b'nurse'), 18, ] e = raises(AssertionError, f, a, b, 'foo') assert str(e) == TYPE % ( - 'foo', unicode, bytes, u'nurse', b'nurse', (1, 'naughty') + 'foo', unicode, bytes, u'nurse', b'nurse', (1, 'profession') ) b = [ u'hello', - dict(naughty=u'nurse'), + dict(profession=u'nurse'), 18.0, ] e = raises(AssertionError, f, a, b, 'foo') @@ -239,7 +239,7 @@ def exp_str(s): # List length mismatch b = [ u'hello', - dict(naughty=u'nurse'), + dict(profession=u'nurse'), 18, 19 ] @@ -249,7 +249,7 @@ def exp_str(s): ) b = [ - dict(naughty=u'nurse'), + dict(profession=u'nurse'), 18, ] e = raises(AssertionError, f, a, b, 'foo') @@ -266,36 +266,39 @@ def exp_str(s): 18, ] e = raises(AssertionError, f, a, b, 'foo') - assert str(e) == KEYS % ('foo', - ['naughty'], [], - exp_str(dict(naughty=u'nurse')), got_str(dict()), + assert str(e) == KEYS % ( + 'foo', + ['profession'], [], + exp_str(dict(profession=u'nurse')), got_str(dict()), (1,) ) # Extra b = [ u'hello', - dict(naughty=u'nurse', barely=u'legal'), + dict(profession=u'nurse', status=u'RN'), 18, ] e = raises(AssertionError, f, a, b, 'foo') - assert str(e) == KEYS % ('foo', - [], ['barely'], - exp_str(dict(naughty=u'nurse')), - got_str(dict(naughty=u'nurse', barely=u'legal')), + assert str(e) == KEYS % ( + 'foo', + [], ['status'], + exp_str(dict(profession=u'nurse')), + got_str(dict(profession=u'nurse', status=u'RN')), (1,) ) # Missing + Extra b = [ u'hello', - dict(barely=u'legal'), + dict(status=u'RN'), 18, ] e = raises(AssertionError, f, a, b, 'foo') - assert str(e) == KEYS % ('foo', - ['naughty'], ['barely'], - exp_str(dict(naughty=u'nurse')), got_str(dict(barely=u'legal')), + assert str(e) == KEYS % ( + 'foo', + ['profession'], ['status'], + exp_str(dict(profession=u'nurse')), got_str(dict(status=u'RN')), (1,) )
_______________________________________________ FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/freeipa-devel@lists.fedorahosted.org/message/AJ6MP2AK7KZADMW7KUWCTYIZEA3AF2CY/