Skip to content

Commit ad14b85

Browse files
crobinsocrazyscientist
authored andcommitted
tests: ro-functional: Handle redhat disabling User.log{in,out}
Signed-off-by: Cole Robinson <[email protected]>
1 parent adf33b6 commit ad14b85

1 file changed

Lines changed: 16 additions & 3 deletions

File tree

tests/test_ro_functional.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -478,13 +478,26 @@ def testFaults(run_cli, backends):
478478
def test_login_stubs(backends):
479479
bz = _open_bz(REDHAT_URL, **backends)
480480

481-
# Failed login, verifies our backends are calling the correct API
481+
# In 2024 bugzilla.redhat.com disabled User.login and User.logout APIs
482+
# for xmlrpc API
483+
482484
with pytest.raises(bugzilla.BugzillaError) as e:
483485
bz.login("foo", "bar")
484486
assert "Login failed" in str(e)
485487

486-
# Works fine when not logged in
487-
bz.logout()
488+
is_rest = bz.is_rest()
489+
is_xmlrpc = bz.is_xmlrpc()
490+
491+
msg = None
492+
try:
493+
bz.logout()
494+
except Exception as error:
495+
msg = str(error)
496+
497+
if is_rest and msg:
498+
raise AssertionError("didn't expect exception: %s" % msg)
499+
if is_xmlrpc:
500+
assert "'User.logout' was not found" in str(msg)
488501

489502

490503
def test_redhat_version(backends):

0 commit comments

Comments
 (0)