Skip to content

Conversation

@codez266
Copy link
Contributor

If 'lastrevid' or 'title' is not returned in response, the response
processing logic errors out.
Fix this by initializing 'lastrevid' with -1 and 'title' with a blank
string and only populating them after checking their presence in
response
Modified test case to catch this error

Phab: https://phabricator.wikimedia.org/T181522

If 'lastrevid' or 'title' is not returned in response, the response
processing logic errors out.
Fix this by initializing 'lastrevid' with -1 and 'title' with a blank
string and only populating them after checking their presence in
response
Modified test case to catch this error
@codecov
Copy link

codecov bot commented Nov 28, 2017

Codecov Report

Merging #13 into master will increase coverage by 0.36%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #13      +/-   ##
==========================================
+ Coverage   50.65%   51.02%   +0.36%     
==========================================
  Files          10       10              
  Lines         535      539       +4     
==========================================
+ Hits          271      275       +4     
  Misses        264      264
Impacted Files Coverage Δ
...ic/utilities/tests/test_fetch_page_wikiprojects.py 100% <ø> (ø) ⬆️
drafttopic/utilities/fetch_page_wikiprojects.py 56.66% <100%> (+1.49%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e5774d4...67304d1. Read the comment docs.

{'talk_page_id': pageid,
'rev_id': page_doc['lastrevid'], 'templates': [],
'talk_page_title': page_doc['title']}
'rev_id': -1, 'templates': [],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A more straightforward way to do this would be page_doc.get('lastrevid', -1)

@halfak halfak merged commit 77f2f56 into master Feb 13, 2018
@halfak halfak deleted the req-revid-fix branch February 13, 2018 16:19
Ladsgroup pushed a commit that referenced this pull request Aug 20, 2018
 
Merge pull request #13 from wiki-ai/req-revid-fix

fetch_page_wikiprojects: Fix page processing logic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants