Files
freeipa/ipatests
Rob Crittenden de64d6724e Fix test_secure_ajp_connector.py failing with Python 3.6.8
Some of the test data are not expected to cause a rewrite in
the upgrade code. Those that do will set the rewrite flag.

In that case there is a new server.xml to be read. This is
handled with mock_open(). The contents can be retrieved via
mocked_file().write.call_args but the repr() of it is:

call(b'<Server port="1234" shutdown="SHUTDOWN">\n  ...')

In at least Python 3.10 one can use write.call_args.args to get
just the raw data. This does not work with Python 3.6.8 and
returns the string 'args' instead results in a TypeError.

TypeError: a bytes-like object is required, not 'str'

Instead drop the args and use the data directly.

For the case of x = mocked_file().write.call_args:

   x[0] is a tuple with the first element being the data
   x[0][0] is the raw data

So use x[0][0] to get at the data instead of x.args[0]

Fixes: https://pagure.io/freeipa/issue/9190

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
2022-06-24 11:36:39 +02:00
..
2022-05-05 17:44:04 +03:00
2019-07-16 13:23:21 +03:00
2020-10-26 17:11:19 +11:00
2021-02-09 09:48:23 -05:00
2022-03-14 10:44:55 -04:00
2015-10-22 18:34:46 +02:00
2022-03-14 10:44:55 -04:00
2016-10-20 18:43:37 +02:00
2021-06-17 09:51:45 +02:00
2022-03-14 10:44:55 -04:00