Last modified: 2014-10-16 01:29:58 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T59602, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 57602 - pywikibot.Site.protect does not have unit tests
pywikibot.Site.protect does not have unit tests
Status: NEW
Product: Pywikibot
Classification: Unclassified
tests (Other open bugs)
core-(2.0)
All All
: Normal normal
: ---
Assigned To: Pywikipedia bugs
:
Depends on:
Blocks: 58941
  Show dependency treegraph
 
Reported: 2013-11-26 17:39 UTC by Merlijn van Deen (test)
Modified: 2014-10-16 01:29 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Merlijn van Deen (test) 2013-11-26 17:39:45 UTC
There is no protect functionality in core yet!

valhallasw@lisilwen:~/src/pwb/pywikibot-core$ python pwb.py protect -links:User:Valhallasw/linkpage -site:test -family:test
Processing page User:Valhallasw
Do you want to change the protection level of [[test:User:Valhallasw]]? ([Y]es, [N]o, [A]ll) Y
Traceback (most recent call last):
  File "pwb.py", line 123, in <module>
    run_python_file(fn, argv, argvu)
  File "pwb.py", line 64, in run_python_file
    exec compile(source, filename, "exec") in main_mod.__dict__
  File "scripts/protect.py", line 286, in <module>
    main()
  File "scripts/protect.py", line 280, in main
    bot.run()
  File "scripts/protect.py", line 137, in run
    move=self.move)
  File "/home/valhallasw/src/pwb/pywikibot-core/pywikibot/__init__.py", line 251, in wrapper
    return method(*__args, **__kw)
  File "/home/valhallasw/src/pwb/pywikibot-core/pywikibot/page.py", line 1417, in protect
    return self.site.protect(self, edit, move, reason)
  File "/home/valhallasw/src/pwb/pywikibot-core/pywikibot/site.py", line 230, in __getattr__
    % (self.__class__.__name__, attr))
AttributeError: APISite instance has no attribute 'protect'
Comment 1 Merlijn van Deen (test) 2013-11-26 19:47:12 UTC
This has been implemented by GEOFBOT, but we should add some unit tests. Actual live testing would depend on a real test wiki, though...
Comment 2 John Mark Vandenberg 2014-07-27 11:40:42 UTC
(In reply to Merlijn van Deen from comment #1)
> This has been implemented by GEOFBOT, but we should add some unit tests.
> Actual live testing would depend on a real test wiki, though...

Why isnt test.wikipedia good enough?
Another option is WMF beta labs...?
Comment 3 John Mark Vandenberg 2014-10-16 01:29:58 UTC
The unit test framework has the ability to flag tests as 'write' tests, so they are not run by default.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links