def test_invalid_not_existing_page_source(self): """Test ProofreadPage from invalid not existing Page as source.""" # namespace is forced source = pywikibot.Page(self.site, self.not_existing_invalid["title"]) fixed_source = pywikibot.Page(self.site, source.title(withNamespace=False), ns=self.site.proofread_page_ns) page = ProofreadPage(fixed_source) self.assertEqual(page.title(), fixed_source.title())
def test_valid_link_source(self): """Test ProofreadPage from valid Link as source.""" source = pywikibot.Link(self.valid['title'], source=self.site, default_namespace=self.site.proofread_page_ns) page = ProofreadPage(source) self.assertEqual(page.title(with_ns=False), source.title) self.assertEqual(page.namespace(), source.namespace)
def test_valid_link_source(self): """Test ProofreadPage from valid Link as source.""" source = pywikibot.Link( self.valid['title'], source=self.site, defaultNamespace=self.site.proofread_page_ns) page = ProofreadPage(source) self.assertEqual(page.title(withNamespace=False), source.title) self.assertEqual(page.namespace(), source.namespace)
def test_invalid_not_existing_page_source(self): """Test ProofreadPage from invalid not existing Page as source.""" # namespace is forced source = pywikibot.Page(self.site, self.not_existing_invalid['title']) fixed_source = pywikibot.Page(self.site, source.title(with_ns=False), ns=self.site.proofread_page_ns) page = ProofreadPage(fixed_source) self.assertEqual(page.title(), fixed_source.title())