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

mwclient / mwclient / 10517585423
76%

Build:
DEFAULT BRANCH: master
Ran 23 Aug 2024 12:17AM UTC
Jobs 1
Files 8
Run time 1min
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.937% (+0.09%) from 69.847%
10517585423

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>

4 of 4 new or added lines in 1 file covered. (100.0%)

64 existing lines in 1 file now uncovered.

777 of 1111 relevant lines covered (69.94%)

1.39 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
64
69.25
0.19% mwclient/client.py
Jobs
ID Job ID Ran Files Coverage
1 10517585423.1 23 Aug 2024 12:17AM UTC 16
69.84
GitHub Action Run
Source Files on build 10517585423
  • Tree
  • List 8
  • Changed 5
  • Source Changed 1
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #10517585423
  • e7c51daa on github
  • Prev Build on master (#10496311941)
  • Next Build on master (#10544661814)
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

© 2025 Coveralls, Inc