• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mwclient / mwclient / 10517585423 / 1
76%
master: 76%

Build:
DEFAULT BRANCH: master
Ran 23 Aug 2024 12:17AM UTC
Files 16
Run time 0s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

23 Aug 2024 12:16AM UTC coverage: 69.842% (+0.09%) from 69.752%
10517585423.1

push

github

AdamWill
Make logged_in more accurate

I found this while writing integration tests. If you try to login
with an incorrect username and password, mwclient correctly raises
mwclient.errors.LoginError...but if you then check logged_in, it
is True. Clearly that's wrong.

The logic for setting logged_in will basically consider us logged
in any time we process an API call and there is no 'anon' key in
the userinfo dict *or there is no userinfo dict at all*. The last
API call processed on a failed login attempt has no userinfo
dict.

This tweaks it so we only changed the logged_in value (in either
direction) if the API call we're handling has a userinfo dict.

We also fix the type of the empty userinfo we create if there
isn't one in the call (no idea why it was a tuple, it doesn't
really matter but it's weird) and explicitly set self.logged_in
to False in Site initialization. I don't think this is strictly
necessary as we can expect the init process to result in at least
one API call with a userinfo dict, but it feels more correct.

Signed-off-by: Adam Williamson <awilliam@redhat.com>

1547 of 2215 relevant lines covered (69.84%)

0.7 hits per line

Source Files on job 10517585423.1
  • Tree
  • List 16
  • Changed 5
  • Source Changed 1
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 10517585423
  • e7c51daa on github
  • Prev Job for on master (#10496311941.1)
  • Next Job for on master (#10544661814.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc