def test_example_1(): a = authors.get_authors(example_1) print a assert a == [ u'CosmicPenguin', u'Denelson83', u'Kwanesum', u'Nationalparks', u'Palaeozoic99', u'Qyd', u'Skookum1', u'The Tom', 'ANONIPEDITS:0' ]
def test_example_1(): a = authors.get_authors(example_1) print a assert a == [ u"CosmicPenguin", u"Denelson83", u"Kwanesum", u"Nationalparks", u"Palaeozoic99", u"Qyd", u"Skookum1", u"The Tom", "ANONIPEDITS:0", ]
def getAuthors(self, title, revision=None): from mwlib.authors import get_authors if self.edits is None: edits = self.edits = {} for edit in self.nuwiki.get_data("edits") or []: try: edits[edit['title']] = edit.get("revisions") except KeyError: continue fqname = self.nshandler.get_fqname(title) fqname = self.redirects.get(fqname, fqname) revisions = self.edits.get(fqname, []) authors = get_authors(revisions) return authors
def _getAuthors(self, title, fqname, revision=None): if getattr(self.nuwiki, 'authors', None) is not None: authors = self.nuwiki.authors[fqname] return authors else: from mwlib.authors import get_authors if self.edits is None: edits = self.edits = {} for edit in self.nuwiki.get_data("edits") or []: try: edits[edit['title']] = edit.get("revisions") except KeyError: continue revisions = self.edits.get(fqname, []) authors = get_authors(revisions) return authors
def test_empty(): assert authors.get_authors([]) == []
def test_example_1(): a = authors.get_authors(example_1) print a assert a == [u'CosmicPenguin', u'Denelson83', u'Kwanesum', u'Nationalparks', u'Palaeozoic99', u'Qyd', u'Skookum1', u'The Tom', 'ANONIPEDITS:0']