Merge pull request #137 from vivre90/patch-5

sync接口兼容 修复
This commit is contained in:
Weston Liu
2016-10-12 18:04:11 +08:00
committed by GitHub
+9 -8
View File
@@ -1116,14 +1116,15 @@ class WXBot:
return dic['BaseResponse']['Ret'] == 0
def test_sync_check(self):
for host in ['webpush.wx', 'webpush2.wx2','webpush.weixin', 'webpush2.weixin2']:
self.sync_host = host
try:
retcode = self.sync_check()[0]
except:
retcode == -1
if retcode == '0':
return True
for host1 in ['webpush.', 'webpush2.']:
for host2 in ['weixin','weixin2','wx','wx2']:
self.sync_host = host1+host2
try:
retcode = self.sync_check()[0]
except:
retcode == -1
if retcode == '0':
return True
return False
def sync_check(self):