def test_isbn(self): site = self.get_site() p1 = pywikibot.Page(site, 'User:M4tx/IsbnTest') # Create the page if it does not exist if not p1.exists() or p1.text != 'ISBN 097522980x': p1.text = 'ISBN 097522980x' p1.save('unit test', botflag=True) main('-page:User:M4tx/IsbnTest', '-always', '-format', '-to13') self.assertEqual(self.newtext, 'ISBN 978-0-9752298-0-4')
def test_isbn(self): """Test the ISBN bot.""" site = self.get_site() p1 = pywikibot.Page(site, "User:M4tx/IsbnTest") # Create the page if it does not exist if not p1.exists() or p1.text != "ISBN 097522980x": p1.text = "ISBN 097522980x" p1.save("unit test", botflag=True) main("-page:User:M4tx/IsbnTest", "-always", "-format", "-to13") self.assertEqual(self.newtext, "ISBN 978-0-9752298-0-4")
def test_isbn(self): """Test using the bot and wikibase.""" main('-page:' + self.test_page_qid, '-always', '-format') self.assertEqual(self.setTarget_value, '0-9752298-0-X') main('-page:' + self.test_page_qid, '-always', '-to13') self.assertTrue(self.setTarget_value, '978-0975229804')
def test_isbn(self): main('-page:' + self.test_page_qid, '-always', '-format') self.assertEqual(self.setTarget_value, '0-9752298-0-X') main('-page:' + self.test_page_qid, '-always', '-to13') self.assertTrue(self.setTarget_value, '978-0975229804')
def test_isbn_to13(self): """Test to13 using the bot and wikibase.""" with empty_sites(): main('-page:' + self.test_page_qid, '-always', '-to13') self.assertTrue(self.setTarget_value, '978-0975229804')
def test_isbn_format(self): """Test format using the bot and wikibase.""" with empty_sites(): main('-page:' + self.test_page_qid, '-always', '-format') self.assertEqual(self.setTarget_value, '0-9752298-0-X')
def test_isbn(self): """Test using the bot and wikibase.""" main("-page:" + self.test_page_qid, "-always", "-format") self.assertEqual(self.setTarget_value, "0-9752298-0-X") main("-page:" + self.test_page_qid, "-always", "-to13") self.assertTrue(self.setTarget_value, "978-0975229804")
def test_isbn_to13(self): """Test to13 using the bot and wikibase.""" main('-page:' + self.test_page_qid, '-always', '-to13') self.assertTrue(self.setTarget_value, '978-0975229804')
def test_isbn_format(self): """Test format using the bot and wikibase.""" main('-page:' + self.test_page_qid, '-always', '-format') self.assertEqual(self.setTarget_value, '0-9752298-0-X')