John Vandenberg has uploaded a new change for review.
https://gerrit.wikimedia.org/r/186340
Change subject: Fix unaligned indents in tests
......................................................................
Fix unaligned indents in tests
Change-Id: I35e8e9fb88feecdcfed7b117d8f073378d503b48
---
M tests/dry_api_tests.py
M tests/dry_site_tests.py
M tests/http_tests.py
M tests/namespace_tests.py
M tests/script_tests.py
M tests/textlib_tests.py
M tests/wikibase_tests.py
M tests/wikidataquery_tests.py
8 files changed, 15 insertions(+), 20 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core
refs/changes/40/186340/1
diff --git a/tests/dry_api_tests.py b/tests/dry_api_tests.py
index 75a384a..d3c4499 100644
--- a/tests/dry_api_tests.py
+++ b/tests/dry_api_tests.py
@@ -168,7 +168,7 @@
action='query', meta='siteinfo')
expect = u'MockSite()User(User:محمد الفلسطيني)' + \
- "[('action', 'query'), ('meta', 'siteinfo')]"
+ "[('action', 'query'), ('meta', 'siteinfo')]"
self.assertEqual(repr(req._uniquedescriptionstr()), repr(expect))
diff --git a/tests/dry_site_tests.py b/tests/dry_site_tests.py
index 45daa10..7544cd5 100644
--- a/tests/dry_site_tests.py
+++ b/tests/dry_site_tests.py
@@ -53,7 +53,7 @@
x._username = ('foo', None)
self.assertEqual('Pywikibot/' + pywikibot.__release__,
- user_agent(x, format_string='{pwb}'))
+ user_agent(x, format_string='{pwb}'))
self.assertEqual(x.family.name,
user_agent(x, format_string='{family}'))
diff --git a/tests/http_tests.py b/tests/http_tests.py
index 722687f..02ba850 100644
--- a/tests/http_tests.py
+++ b/tests/http_tests.py
@@ -266,7 +266,7 @@
self.assertEqual('', http.user_agent(format_string='{lang}'))
self.assertEqual('Pywikibot/' + pywikibot.__release__,
- http.user_agent(format_string='{pwb}'))
+ http.user_agent(format_string='{pwb}'))
self.assertNotIn(' ', http.user_agent(format_string=' {pwb} '))
self.assertIn('Pywikibot/' + pywikibot.__release__,
diff --git a/tests/namespace_tests.py b/tests/namespace_tests.py
index 703e4c2..34e53a0 100644
--- a/tests/namespace_tests.py
+++ b/tests/namespace_tests.py
@@ -226,9 +226,9 @@
self.assertEqual(Namespace.resolve([file_ns]), [file_ns])
self.assertEqual(Namespace.resolve([file_ns, special_ns]),
- [file_ns, special_ns])
+ [file_ns, special_ns])
self.assertEqual(Namespace.resolve([file_ns, file_ns]),
- [file_ns, file_ns])
+ [file_ns, file_ns])
self.assertEqual(Namespace.resolve(6), [file_ns])
self.assertEqual(Namespace.resolve('File'), [file_ns])
diff --git a/tests/script_tests.py b/tests/script_tests.py
index 6810a00..3448c45 100644
--- a/tests/script_tests.py
+++ b/tests/script_tests.py
@@ -285,7 +285,7 @@
# But also complain if there is any stdout
# but ignore shell.py emiting its '>>> ' prompt.
if ((script_name == 'shell' and
- set(result['stdout']).issubset(set('> \n')))
+ set(result['stdout']).issubset(set('> \n')))
or result['stdout'] == ''):
result['stdout'] = None
self.assertIsNone(result['stdout'])
diff --git a/tests/textlib_tests.py b/tests/textlib_tests.py
index 630ced4..49ba7d2 100644
--- a/tests/textlib_tests.py
+++ b/tests/textlib_tests.py
@@ -103,7 +103,7 @@
dry = True
catresult = ('[[Category:Cat1]]%(LS)s[[Category:Cat2]]%(LS)s'
- % {'LS': config.LS})
+ % {'LS': config.LS})
def test_category_format_raw(self):
self.assertEqual(self.catresult,
diff --git a/tests/wikibase_tests.py b/tests/wikibase_tests.py
index c07a03f..34521b0 100644
--- a/tests/wikibase_tests.py
+++ b/tests/wikibase_tests.py
@@ -434,8 +434,8 @@
# and that exception should refer to the source title 'Test page'
# not the Item being created.
self.assertRaisesRegex(pywikibot.NoPage, 'Test page',
- pywikibot.ItemPage.fromPage,
- page, lazy_load=False)
+ pywikibot.ItemPage.fromPage,
+ page, lazy_load=False)
item = pywikibot.ItemPage.fromPage(page, lazy_load=True)
@@ -644,15 +644,11 @@
super(TestWriteNormalizeData, self).setUp()
self.data_out = {'aliases':
{'en':
- [
- {'language': 'en',
- 'value': 'Bah'}
- ],
+ [{'language': 'en', 'value': 'Bah'}],
},
'labels':
{'en':
- {'language': 'en',
- 'value': 'Foo'},
+ {'language': 'en', 'value': 'Foo'},
}
}
@@ -880,8 +876,8 @@
self.assertRaises(pywikibot.WikiBaseError,
pywikibot.ItemPage.fromPage, self.wdp)
self.assertRaisesRegex(pywikibot.WikiBaseError,
- 'no transcluded data',
- self.wdp.data_item)
+ 'no transcluded data',
+ self.wdp.data_item)
class TestJSON(WikidataTestCase):
diff --git a/tests/wikidataquery_tests.py b/tests/wikidataquery_tests.py
index 07822f0..04266c5 100644
--- a/tests/wikidataquery_tests.py
+++ b/tests/wikidataquery_tests.py
@@ -105,14 +105,13 @@
self.assertEqual(str(q), "claim[99]")
q = query.HasClaim(PropertyPage(self.repo, "P99"),
- ItemPage(self.repo, "Q100"))
+ ItemPage(self.repo, "Q100"))
self.assertEqual(str(q), "claim[99:100]")
q = query.HasClaim(99, [100, PropertyPage(self.repo, "P101")])
self.assertEqual(str(q), "claim[99:100,101]")
- q = query.StringClaim(PropertyPage(self.repo, "P99"),
- "Hello")
+ q = query.StringClaim(PropertyPage(self.repo, "P99"), "Hello")
self.assertEqual(str(q), 'string[99:"Hello"]')
q = query.Tree(ItemPage(self.repo, "Q92"), [1], 2)
--
To view, visit https://gerrit.wikimedia.org/r/186340
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I35e8e9fb88feecdcfed7b117d8f073378d503b48
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits