Skip to content
This repository has been archived by the owner on Jul 21, 2022. It is now read-only.

Some test cases failed #80

Open
bestmoon opened this issue Jul 4, 2016 · 2 comments
Open

Some test cases failed #80

bestmoon opened this issue Jul 4, 2016 · 2 comments

Comments

@bestmoon
Copy link

bestmoon commented Jul 4, 2016

In test/zhihu-test.py, some tests failed.
我的测试环境是windows 7, python 3.5.2.

# 获取关注问题的用户
for _, follower in zip(range(10), question.followers):
    print(follower.name)

# 获取提问时间
ctime = question.creation_time
print(ctime)
assert ctime == datetime.strptime('2014-08-12 17:58:07', "%Y-%m-%d %H:%M:%S")

# 获取最后编辑时间
last_edit_time = question.last_edit_time
print(last_edit_time)
assert last_edit_time >= datetime.strptime('2015-04-01 00:39:21', "%Y-%m-%d %H:%M:%S")

# 获取该答案所在问题标题
print(answer.question.title)

# 获得用户粉丝
for _, follower in zip(range(10), author.followers):
    print(follower.name)

只是run了一下zhihu-test.py, 发现以上几个test好像跑不通。
一部分报错信息如下。

===== test failed =====
Cleaning...Done
Traceback (most recent call last):
  File "zhihu-test.py", line 869, in <module>
    raise e
  File "zhihu-test.py", line 863, in <module>
    'test()', setup='from __main__ import test', number=1)
  File "C:\Python3\lib\timeit.py", line 213, in timeit
    return Timer(stmt, setup, timer, globals).timeit(number)
  File "C:\Python3\lib\timeit.py", line 178, in timeit
    timing = self.inner(it, self.timer)
  File "<timeit-src>", line 6, in inner
  File "zhihu-test.py", line 813, in test
    test_question()
  File "zhihu-test.py", line 34, in test_question
    for _, follower in zip(range(10), question.followers):
  File "C:\Python3\lib\site-packages\zhihu_py3-0.3.17-py3.5.egg\zhihu\question.p
y", line 172, in followers
  File "C:\Python3\lib\site-packages\zhihu_py3-0.3.17-py3.5.egg\zhihu\common.py"
, line 225, in common_follower
  File "C:\Python3\lib\site-packages\requests-2.10.0-py3.5.egg\requests\models.p
y", line 812, in json
    return complexjson.loads(self.text, **kwargs)
  File "C:\Python3\lib\json\__init__.py", line 319, in loads
    return _default_decoder.decode(s)
  File "C:\Python3\lib\json\decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Python3\lib\json\decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
@7sDream
Copy link
Owner

7sDream commented Jul 5, 2016

是这个样子,因为前端经常变,所以这边这个项目已经挺久没有维护了,您可以换用这个新的:
https://github.com/7sDream/zhihu-oauth

新项目架构比较好,而且可能的 Bug 也很少,效率也更高一点。

然后这边的bug我会隔大概一个月集中处理一下……现在暂时先放放

@bestmoon
Copy link
Author

bestmoon commented Jul 5, 2016

多谢你的回复,我找到了一个work around,能先用目前的code了。
等过些日子,我也会转到你新的oauth project上。谢谢!

You can close this ticket. I am fine with that. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants