mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-23 07:33:27 -06:00
9a97f9b40c
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> |
||
---|---|---|
.. | ||
data | ||
test_install | ||
__init__.py | ||
httptest.py | ||
test_adtrust_mockup.py | ||
test_changepw.py | ||
test_dnssec.py | ||
test_i18n_messages.py | ||
test_ipap11helper.py | ||
test_jsplugins.py | ||
test_kadmin.py | ||
test_ldap.py | ||
test_migratepw.py | ||
test_otptoken_import.py | ||
test_rpcserver.py | ||
test_secrets.py | ||
test_secure_ajp_connector.py | ||
test_serverroles.py | ||
test_topology_plugin.py | ||
test_version_comparison.py |